Re: [code] [textadept]control+tab with MRU

From: Gabrielm Dubatti <gdubatti.att.gmail.com>
Date: Sat, 19 Mar 2016 20:39:10 -0300

Hi,

I added "local" in front of the functions to limit their visibility.
The code is now added to the wiki (waiting a bit before linking it to
the main page).
If you like, you can check it at: http://foicica.com/wiki/control-tab-mru

Any comments, bugs or suggestions are welcome.

Best wishes,
Gabriel

El 19/03/16 a las 17:57, Hugh Low escribió:
>
> Hey, I had a quick read of your code.
>
> Instead of using the check ‘if code == 0xFFE3 then --control key
> pressed?’ on KEYPRESS events, might the following code be more efficient?
>
> events.connect(events.KEYPRESS, function(code, shift, control, alt, meta)
>
> if (not control) or (code ~= 9) then -- (9 == string.byte(‘\t’))
>
> return;
>
> elseif shift then -- control-shift-tab
>
> else -- control-tab
>
> end
>
> ctrl_key_down = true;
>
> end);
>
> Apologies in advance if I’ve missed something obvious which renders
> the above code useless. One other thing, are all the globally defined
> variables intended to be global? They will pollute textadept’s _ENV.
>
> I’m quite excited about this idea. Would you mind sending another
> e-mail when you commit your final draft to the wiki?
>
> Thanks in advance 😊
>
> Hugh
>
> *From: *Gabrielm Dubatti <mailto:gdubatti.att.gmail.com>
> *Sent: *19 March 2016 20:00
> *To: *code.att.foicica.com <mailto:code.att.foicica.com>
> *Subject: *[code] [textadept]control+tab with MRU
>
> Hi,
>
> Here is the code I wrote to implement control+tab and control+shift+tab
> buffer cycling using a MRU list (like a lot of other editors/IDE do).
> Holding the control key down while pressing tab / shift tab, allows you
> to select the buffer to jump into.
>
> I will sincerely appreciate if someone test it and/or send me some
> feedback before I published it in the wiki.
>
> To try it, just add the code to your init.lua file.
>
> Best wishes,
> Gabriel
> ............
> ............
> --
> You are subscribed to code.att.foicica.com.
> To change subscription settings, send an e-mail to code+help.att.foicica.com.
> To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
>

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Sat 19 Mar 2016 - 19:39:10 EDT

This archive was generated by hypermail 2.2.0 : Sun 20 Mar 2016 - 06:36:46 EDT