synesthesia icon indicating copy to clipboard operation
synesthesia copied to clipboard

Highlighting is not remembered across restart of Sublime

Open angularsen opened this issue 9 years ago • 8 comments

It's remembered for the file I had last open, but I can't apply the style to other files after a restart. Basically I just open my log.json file, stored in an arbitrary folder, compile it, apply the log highlighting to my log file, restart Sublime, then try to apply the highlighting to another file and it's no longer available. Need to compile again.

Anything I'm doing wrong?

angularsen avatar May 28 '15 08:05 angularsen

Hmm, might be a bug on my end. Are you using ST3? When you go to the plugin's package directory (command palette > Browse Packages), do you see the tmTheme/tmLanguage/sublime-settings files there?

dariusf avatar May 28 '15 09:05 dariusf

Using ST3. I see the files just after having compiled and applied the syntax highlighting to file X. If I restart, it still exists, but if I then close the tab for file X (with highlighting still applied) the entire synesthesia folder is deleted from the Packages folder.

angularsen avatar May 28 '15 20:05 angularsen

That sounds like a conflict with another plugin. The only deletions that should be happening are to the tmTheme/tmLanguage, etc. files within the plugin directory, and only when you trigger the deletion command (which is through the command palette).

Are you using any plugins which hook into the 'tab closed' event? Is there any output in the console (Ctrl + `)?

dariusf avatar May 29 '15 03:05 dariusf

This is the console upon compiling my log syntax.

C:\Users\Andreas\AppData\Roaming\Sublime Text 3\Packages\synesthesia does not exist; created
C:\Users\Andreas\AppData\Roaming\Sublime Text 3\Installed Packages\Synesthesia.sublime-package
Written to C:\Users\Andreas\AppData\Roaming\Sublime Text 3\Packages\synesthesia\log.tmLanguage.
Written to C:\Users\Andreas\AppData\Roaming\Sublime Text 3\Packages\synesthesia\log.tmTheme.
Written to C:\Users\Andreas\AppData\Roaming\Sublime Text 3\Packages\synesthesia\log.sublime-settings.
reloading Packages/synesthesia/log.sublime-settings
generating syntax summary

Then I restarted Sublime, and these are the parts I found relevant

...
plugins loaded
Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 288, in on_selection_modified
    callback.on_selection_modified(v)
  File "tag_lint in C:\Users\Andreas\AppData\Roaming\Sublime Text 3\Installed Packages\Tag.sublime-package", line 59, in on_selection_modified
AttributeError: type object 'Pref' has no attribute 'enable_live_tag_linting'
SublimeLinter: debug mode: off 

Package Control: Removed directory for orphaned package synesthesia
reloading Packages/synesthesia/log.sublime-settings
generating syntax summary

Does that tell you anything?

You are probably right about conflicting plugins. I'll try removing some that seem likely suspects.

angularsen avatar May 29 '15 20:05 angularsen

I've removed most packages I feel I can live without. The remaining are mostly about syntax highlighting and prettifying tools, so I don't think they should interfere.

By the way, it was not when I closed tab X, it was just that it took some time for the package manager to load all plugins and do its thing. As you see from the console snippet above, it is package control that determines synesthesia is an orphaned package and removes it. I just tried reinstalling synesthesia, but still no good.

angularsen avatar May 29 '15 20:05 angularsen

Ah, I get it now. Package Control doesn't like when a plugin is installed, and it finds a directory with the same name under Packages. That's usually indicative of an error as far as it's concerned. I'll need to find another location to read/write files from/to. Will update you and release a new version when I figure out where they should go.

I don't think the problem is with your plugins. Sorry for the inconvenience!

dariusf avatar Jun 01 '15 10:06 dariusf

No worries, thanks for looking into this. I like your plugin, great work!

angularsen avatar Jun 01 '15 10:06 angularsen

I've released an update. Hopefully it fixes this problem!

dariusf avatar Jun 12 '15 02:06 dariusf