Re: [code] [textadept] Latest Changes in hg

From: Robert Gieseke <>
Date: Thu, 12 Sep 2013 13:04:47 +0200

Am 9/11/13 5:39 PM, schrieb Mitchell:
>> I'm trying to understand the new INITIALIZED event. My problem is that
>> modules that piggy-back on user theme styles like Textredux or
>> highlighting the margins for the active buffer are now loaded before
>> any buffer is actually loaded.
> INITIALIZED is not what you want; it is run pretty much at the end of
> the startup process. Connect to VIEW_NEW for setting view stuff like
> margin colors and BUFFER_NEW for buffer-specific stuff. Theme colors and
> styles are available with either event if you need them. Those events
> are run as early as possible.
>> For the margin highlighting it's easy to workaround by wrapping the
>> code in an INITIALIZED event, for Textredux this is a bit more
>> convoluted since other modules depend on its style module.
>> Is there a way to get theme properties before any file is loaded?
>> Maybe I'm misunderstanding things …
> If you connect to VIEW_NEW or BUFFER_NEW, you can use
>['...'] to get all theme information. This happens before
> any file is loaded.
> I'm not sure I fully understand the problem, but I hope this helps.

Apologies for not linking to code examples. To highlight the margin I
used this:

When I just stop caching the color values this works fine!

But for Textredux I'm still a bit stuck. In the '' we generate
default styles the other styles used for lists etc. are based on
This 'style' module is required by other modules and loaded before
INITIALIZED is emitted.
Maybe I have to rewrite this to lazily read the default styles.

As a workaround I can wrap requiring like
events.connect(events.INITIALIZED, function()
   require 'textredux.hijack'
   common = require 'common'


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Thu 12 Sep 2013 - 07:04:47 EDT

This archive was generated by hypermail 2.2.0 : Fri 13 Sep 2013 - 06:44:58 EDT