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

From: Mitchell <m.att.foicica.com>
Date: Fri, 20 Mar 2015 13:58:15 -0400 (EDT)

Hi Joshua,

On Fri, 20 Mar 2015, Joshua Krmer wrote:

> On 2015-02-17, 10:52, Mitchell wrote:
>
>>> 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.
>
> Because the changed content cannot be determined, I decided to
> recalculate all tabstops in the visible area whenever UPDATE_UI is
> omitted (except selection changes) or the buffer is switched.
>
> To try it out, copy the attached file lua.init to
> ~/.textadept/modules/elastic_tabstops/
>
> Then add the following to ~/.textadept/init.lua:
>
> events.connect('update_ui', function(updated)
> _M.elastic_tabstops.reset_visible(updated)
> end)
>
> events.connect('buffer_after_switch', function()
> _M.elastic_tabstops.reset_visible(1)
> end)

Thanks for your efforts! I feel kind of dumb that I don't know how to use
this... Perhaps you could place it on the wiki along with some
instructions on how to use it? I'm sure it will be of great benefit to
others :)

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 Fri 20 Mar 2015 - 13:58:15 EDT

This archive was generated by hypermail 2.2.0 : Sat 21 Mar 2015 - 06:29:45 EDT