Home Download Buy Blog Forum Support

Broadcasting notifications to other plugins

Broadcasting notifications to other plugins

Postby MSch on Wed Jan 25, 2012 1:09 pm

Hi,

I'd like to make TrailingSpaces Vintage aware. What I'd like to do is to add some code to TrailingSpaces to check if Vintage is loaded and if so register for some custom event that Vintage sends whenever insert mode is entered and then disable highlighting of trailing spaces for the current line.

Is there a way to do that?

Cheers,
Martin
MSch
 
Posts: 15
Joined: Fri Jan 13, 2012 11:46 pm

Re: Broadcasting notifications to other plugins

Postby abrookins on Fri Feb 03, 2012 1:35 pm

Vintage mode stores a value in settings that should tell you whether or not the user is in 'command mode.'

So, you could register a callback with the sublime.Settings.add_on_change() method that gets called when the setting 'command_mode' changes. Then test for the value you need and perform your operations.

http://www.sublimetext.com/docs/2/api_r ... e.Settings

I haven't tested this approach, but it's worth trying.
abrookins
 
Posts: 4
Joined: Fri Feb 03, 2012 3:07 am


Return to Plugin Development

Who is online

Users browsing this forum: MarcusF and 3 guests