Re: [textadept] Re: buffer list

From: mitchell <>
Date: Fri, 10 Dec 2010 08:59:01 -0500 (Eastern Standard Time)


> Instead of using a dialog, what about some sort popup, like used for
> name completion? Is it possible to use something like that to instead
> popup a buffer selection list?

Yes. Use buffer:user_list_show() and handle the selection with
events.connect('user_list_selection', ...)

> Also, regarding keyboard usage, can the key handler detect events on a
> fine-grained-enough level to act on key-up and -down? Eg, if I wanted
> to popup something and simulate alt-tab-like behavior where I can hold
> the alt key down press or release the tab key, and the selector list
> stays visible until I release the alt too.

Unfortunately not.


> Scott
> On Dec 9, 4:09�pm, mitchell <> wrote:
>> Hi Scott,
>>> Is there a way to sort the open buffers that show up in the buffer
>>> list in the switch buffer dialog?
>> Not in the current implementation. The default order is the order in the
>> _BUFFERS table so when a selection is made, the dialog (gcocoadialog)
>> returns the index of the item selected, hence the index in _BUFFERS so
>> it's really easy to make the switch. If you wanted to sort the buffers,
>> you'd have to create your own function that calls gui.dialog() using a
>> sorted version of _BUFFERS (table.sort using a function that sorts by
>> whatever you desire) and either have another column with index in _BUFFERS
>> that you can get from what the dialog returns or search _BUFFERS for the
>> buffer with the filename selected. It's pretty complicated. There is
>> documentation on gcocoadialog towards the bottom of:
>> You are interested in GCDIALOG_FILTEREDLIST. If you choose
>> to keep the same "filename | path" table structure, --output-column would
>> be important in this case since you are returning the buffer index or full
>> path.
>> This is complicated stuff so feel free to ask more questions if this is
>> what you want to do.
>>> Also, is it possible to make the up and down arrows roll over, so that
>>> up arrow from the top moves to the bottom of the list, and vice versa?
>> Possibly, but you can just use the 'Home' and 'End' keys. Feel free to
>> submit a patch to gcocoadialog though (see above link). I may include it.
>> mitchell
> --
> You received this message because you are subscribed to the Google Groups "textadept" group.
> To post to this group, send email to
> To unsubscribe from this group, send email to
> For more options, visit this group at

Received on Fri 10 Dec 2010 - 08:59:01 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:55:54 EST