Re: [code] [textadept] A feature for tabs

From: Mitchell <m.att.foicica.com>
Date: Mon, 9 Dec 2013 13:10:12 -0500 (Eastern Standard Time)

Hi Richard and Ryan,

On Sat, 7 Dec 2013, Ryan Pusztai wrote:
> On Dec 7, 2013 10:41 AM, "Richard Philips" <richard.philips.att.gmail.com>
> wrote:
>
>> Hi,
>>
>> I have to admit, having tabs in Textadept is kind of growing on me :-)
>>
>> It would be nice if it was possible to close a buffer through its tab.
>> E.g. in Firefox, tabs are equipped with a 'x'. A click on that 'x', closes
>> the tab (and buffer).

Textadept's C core is very close to hitting its 2000 line limit. Adding an
'x' button will likely push ta over that limit, so I highly doubt I'll add
this. Even assigning a configurable mouse button (like middle-click) will
probably push it over. Hard-coding a mouse button might work, but some
users will probably complain.

> I agree the tabs are pretty good. Thanks so much for adding them.
>
> Along with the ability to close them I would like to be able to rearrange
> then by dragging. It helps keep them organized and allows for ctrl+tab in
> the order you would like, especially since TA doesn't cycle through buffers
> in the order of last used.

The tabs are tied to the _BUFFER table so any reordering of tabs needs to
update that table in place. This is not trivial in C, and would likely
push ta over its limit. I do recognize the usefulness of this and will
look into it, however it's likely that I won't add support.

> (which would be a great feature as well, since most other GUI editors
> function this way)

I have the following in my init.lua that accomplishes something similar:

     local last_buffer = buffer
     -- Save last buffer. Useful after ui.switch_buffer().
     events.connect(events.BUFFER_BEFORE_SWITCH, function()
       last_buffer = _G.buffer
     end)
     keys['az'] = function()
       if (_BUFFERS[last_buffer]) then
         _G.view:goto_buffer(_BUFFERS[last_buffer])
       end
     end

Cheers,
Mitchell

-- 
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 Mon 09 Dec 2013 - 13:10:12 EST

This archive was generated by hypermail 2.2.0 : Tue 10 Dec 2013 - 06:31:31 EST