Re: [textadept] buffer list

From: mitchell <>
Date: Thu, 9 Dec 2010 09:09:10 -0500 (Eastern Standard Time)

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

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.

Received on Thu 09 Dec 2010 - 09:09:10 EST

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