Re: [code] Trouble setting buffer.edge_mode for a specific language without affecting other tabs

From: Robert Gieseke <rob.g.att.web.de>
Date: Wed, 11 Jun 2014 08:03:41 +0200

Hi Kevin,

Am 11/06/14 04:08, schrieb Kevin Thiart:
> Hi
>
> I'm trying to set buffer.edge_mode in TextAdept for Python files
> only, without affecting any non-Python files.
>
> Some info:
> - I'm running revision b44a9cbb568e of TextAdept on Ubuntu 14.04.
> - I also cloned and installed revision 8151bdcf7b66 of the
> official Python module.
>
> Everything up to this point works 100% as expected.
>
> Then I added a post_init.lua file to the ~/.textadept/modules/python
> folder with the following contents:
>
> -- ~/.textadept/modules/python/post_init.lua
> events.connect(events.LEXER_LOADED, function(lang)
> if lang == 'python' then
> buffer.edge_column = 70
> buffer.edge_mode = buffer.EDGE_LINE
> end
> end)
>
> Now, after restarting TextAdept, whenever I open a Python file
> the edge line shows up for all open tabs, Lua files included.
>
> Is there some other event or check that I should be using?
>

you need to reset the default settings, for example no edge_column:

events.connect(events.LEXER_LOADED, function(lang)
   if lang == 'python' then
     buffer.edge_column = 70
     buffer.edge_mode = buffer.EDGE_LINE
   else
     buffer.edge_mode = buffer.EDGE_NONE
   end
end)

There are some buffer properties that are shared between buffer
instances within one view.

Cheers,
Robert

-- 
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 Wed 11 Jun 2014 - 02:03:41 EDT

This archive was generated by hypermail 2.2.0 : Wed 11 Jun 2014 - 06:32:03 EDT