Re: [code] Re: [textadept] Feature request: Elastic tabstops

From: Mitchell <m.att.foicica.com>
Date: Mon, 5 Jan 2015 11:56:23 -0500 (EST)

Hi Joshua,

On Mon, 5 Jan 2015, Joshua Krämer wrote:

> On 2015-01-05, 9:41, Mitchell wrote:
>
>> On Sat, 3 Jan 2015, Joshua Krämer wrote:
>>
>>> Thanks for the information. I will happily port the algorithm to
>>> Lua, but I will need some guidance/help with the Textadept
>>> integration. Would you agree to help with that?
>>
>> Sure.
>
> Great. Here is a first question.
>
> The Scintilla message to set an explicit tab stop at distance x in
> px is: SCI_ADDTABSTOP(int line, int x)
>
> I could not find an equivalent in the Textadept API. Is there an
> undocumented way to do this?

Yes. Textadept's buffer API closely follows Scintilla's API. A more useful
representation of Scintilla's API is Scintilla's "include/Scintilla.iface"
file. (Textadept references it when generating its buffer API.) Search in
that file for "AddTabStop" and you'll see this:

   fun void AddTabStop=2676(int line, int x)

Since AddTabStop is a function with two parameters, Textadept maps it to
this:

   function buffer:add_tab_stop(line, x) end

Even though this function is undocumented, it actually exists.
(You can look at "core/.buffer.luadoc" for all buffer functions and
properties Textadept knows about, documented or not.)

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 05 Jan 2015 - 11:56:23 EST

This archive was generated by hypermail 2.2.0 : Tue 06 Jan 2015 - 06:35:05 EST