Sublime Forum

Syntax Highlighting (for SublimePuppet) Initially Wrong

#1

I’ve been using Sublime Text (of course!) to edit Puppet .pp files, using the SublimePuppet module, and I have a weird problem – Syntax highlighting is initially wrong for these files! The field in the lower right corner of the window says it’s in “Puppet” mode, but the highlighting is very wrong. If I click on that field and select “Puppet” from the pop-up menu (which, I’ll note, doesn’t have a checkbox next to it until I do this), it will start syntax highlighting correctly.

I don’t know if this is a bug in the SublimePuppet module, in Sublime Text (I kind of doubt it), or my configuration, but I was hoping someone could point me the right direction.

An example of the syntax highlighting for a freshly loaded file:

… I would post an example of the correctly syntax highlighted version (after selecting ‘Puppet’ from the menu at the lower right corner), but apparently I’m only allowed to post a single image per message – so you’ll just have to take my word that once I do that, it syntax highlights correctly.

Not the end of the world, but definitely quite annoying to have to do this for every file. Help?

0 Likes

#2

The symptoms of your issue sound similar to the one reported in this forum post. I’d check for that package or others doing something similar.

1 Like

#3

you can check which package the syntax is coming from by entering the following in the ST console (View menu -> Show Console):

view.settings().get('syntax') Enter

0 Likes

#4

Aha, the problem in @OdatNurd’s link is indeed the same as my problem:

>>> view.settings().get('syntax')
'Packages/Theme - Mersi/icons/Langs/Puppet.tmLanguage'

…so the solution there was to uninstall that theme and use a different one. Is there a way to resolve this problem without having to find a new theme (…which tends to be like an all-day project for me)? As a short-term workaround, I can delete that file from the extracted package, but if I reinstall it (or switch to a different computer), I’ll have the same problem again. Is there a workaround that could save me from that?

Thanks!

0 Likes