Re: [textadept] Re: buffer list

From: Brian Schott <briancsch....at.gmail.com>
Date: Mon, 13 Dec 2010 01:25:25 -0800

1. The old value of the list separator is saved
2. The separator is set to be the pipe character. byte() is called
because Scintilla expects the ascii code instead of a lua string
3. The list is shown to the user
4. The old separator character is reset.

The reason that the separator is set to be the pipe is that it defaults
to the space character. If the items in the list had spaces, the list
would appear incorrectly. See this page:
http://www.scintilla.org/ScintillaDoc.html#SCI_AUTOCSETSEPARATOR

The Scintilla documentation is really useful when writing extensions to
Textadept. You'll want to bookmark this page:
http://www.scintilla.org/ScintillaDoc.html

On 12/13/2010 01:11 AM, Scott Weisman wrote:
> Can you explain what these lines are for:
>
> local sep = buffer.auto_c_separator
> buffer.auto_c_separator = ('|'):byte()
> buffer:user_list_show(BUFFER_LIST_TYPE, table.concat(items, '|'))
> buffer.auto_c_separator = sep
>
Received on Mon 13 Dec 2010 - 04:25:25 EST

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