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

From: Mitchell <m.att.foicica.com>
Date: Tue, 17 Feb 2015 10:52:51 -0500 (EST)

Hi Joshua,

On Sun, 15 Feb 2015, Joshua Krmer wrote:

> Hi Mitchell,
>
> I have finally had the time to port the Elastic tabstops algorithm. It
> is only a quick-and-dirty conversion at the moment, but it works. A
> module file with the code is attached.
>
> Now I have two questions:
>
> The reset function recalculates the tabstops in a given text area. Is
> it possible to run this reset function whenever a change in a buffer
> occurs on the changed area? I could not find a corresponding event.

There is no way to determine this information. The argument passed to
`events.UPDATE_UI` will let you know if the content itself changes, but
not what that content was.

> Whenever a buffer is switched, the fixed-width tabstops are restored.
> Can this be disabled, so the calculated tabstops are made permanent?

You'll have to save them in an `events.BUFFER_BEFORE_SWITCH` event and
restore them in an `events.BUFFER_AFTER_SWITCH` event. See `core/ui.lua`'s
event pair for saving stuff like folds.

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 Tue 17 Feb 2015 - 10:52:51 EST

This archive was generated by hypermail 2.2.0 : Wed 18 Feb 2015 - 06:32:14 EST