0

Is there an event that I can hook into for when a tmLanguage file is used on the current file opened in the Sublime Text Plugin API?

I have this project https://github.com/samholmes/EJS.tmLanguage and I have this issue https://github.com/samholmes/EJS.tmLanguage/issues/7#issuecomment-37764728

What I need is to be able to run some code when a file is opened in Sublime that is an EJS file. This way I can check a variable to see which of the two tmLanguage files was last used and call set_syntax_file accordingly.

Sam
  • 6,414
  • 11
  • 46
  • 61

1 Answers1

0

See sublime_plugin.EventListener#on_load in the ST2 and ST3 docs. You may also be interested in Settings#add_on_change. Though you can solve stuff in your plugin, you may also want to suggest ApplySyntax to your users as a more generic solution.

skuroda
  • 19,514
  • 4
  • 50
  • 34