Re: [code] Turning off syntax highlighting/theme

From: Mitchell <m.att.foicica.com>
Date: Sun, 13 Mar 2016 19:53:23 -0400 (EDT)

Hi Arnel,

On Sun, 13 Mar 2016, Arnel wrote:

>
> Hello,
>
> Is there a way to turn off syntax highlighting or the theme without editing
> 'ui.lua'?
>
> If I comment out the 'ui.set_theme()' line in my 'init.lua' it will revert to
> the default theme which is 'light.lua.' If I'm not mistaken, the only other
> option is to somehow "disable" the buffer properties set in the theme you are
> currently using (setting their values to nil, maybe?).
>
> It doesn't appear to have been discussed in the mailing list archives, so I'd
> appreciate some pointers. Thanks in advance.

If you're accustomed to the light theme, then this might look okay in your
~/.textadept/init.lua:

     local syntax_off = function()
       buffer:style_clear_all()
       -- Optionally set styles for line numbers (style #33), etc.
     end
     keys.cal = function()
       events.connect(events.LEXER_LOADED, syntax_off)
     end)
     keys.caL = function()
       events.disconnect(events.LEXER_LOADED, syntax_off)
     end

Ctrl+Alt+L will turn off syntax highlighting and Ctrl+Alt+Shift+L will
turn it back on the next time you load/switch buffers.

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 Sun 13 Mar 2016 - 19:53:23 EDT

This archive was generated by hypermail 2.2.0 : Mon 14 Mar 2016 - 06:37:54 EDT