Re: [code] buffer:set_theme does not work

From: Mitchell <m.att.foicica.com>
Date: Tue, 10 Apr 2018 14:26:51 -0400 (EDT)

Hi Milind,

On Mon, 9 Apr 2018, Milind Gupta wrote:

> Hi Mitchell,
> I have that command in my init.lua already and that is why reset works
> because it already knew I had set the theme. But it does not load it
> automatically. I am using textadept on Windows 7.

Is your `buffer:set_theme()` call by itself in your init.lua? (e.g. not in a function, event handler, etc.) Starting in version 10, Textadept monitors any direct `buffer` API calls and applies those exact calls to subsequent buffers. This includes `buffer:set_theme()`. If that call happens indirectly (e.g. event handler, key command, etc.), the theme settings will not apply to subsequent buffers.

You can also temporarily create a new init.lua with only your `buffer:set_theme()` and see if that works. If so, there's something else in your init.lua that is causing trouble.

Cheers,
Mitchell

>
> Thanks,
> Milind
>
> On Sun, Apr 8, 2018 at 7:54 AM, Mitchell <m.att.foicica.com> wrote:
>
>> Hi Milind,
>>
>> On Sun, 8 Apr 2018, Milind Gupta wrote:
>>
>> Hi,
>>> If I give the path to the theme file like dark.lua like:
>>>
>>> buffer:set_theme("Path/To/dark.lua")
>>>
>>> it does not get loaded automatically. But after opening a file if I do
>>> reset in the command entry then I see it applied. Is there something I am
>>> missing here? On opening another file in another tab its the same thing.
>>> For the theme to be applied I need to do reset after opening the file.
>>>
>>
>> If you want a theme setting to persist, put that `buffer:set_theme(...)`
>> call in your *~/.textadept/init.lua* file.
>>
>> 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.
>>
>>
>

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 10 Apr 2018 - 14:26:51 EDT

This archive was generated by hypermail 2.2.0 : Wed 11 Apr 2018 - 06:46:43 EDT