Sublime Forum

Broadcasting notifications to other plugins

#1

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

0 Likes

#2

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.

sublimetext.com/docs/2/api_r … e.Settings

I haven’t tested this approach, but it’s worth trying.

0 Likes