Sublime Forum

Syntax Color Coding not loading with HTML

#1

For some reason, any time I open an HTML file, the syntax color coding doesn’t load with it. Works fine for every other file type, but HTML? Loads in as white plain text and I have to manually “Set Syntax: HTML”.

My custom HTML snippets work, though, even when no color coding appears. I’ve removed all preferences, uninstalled and reinstalled ST4 (was using 3 when the problem started) and it still persists. It’s really annoying… any insights?

0 Likes

#2

Does it happen in safe mode? What file extension are your HTML files using?

0 Likes

#3

What is returned by executing view.syntax() in ST’s console for such html file before manually setting HTML syntax?

There are 2 possible reasons:

  1. html file extensions are assigned plain text syntax (via Open all with current extension as… menu)
  2. a package shipping dummy syntaxes for files with your extension, augmenting basic HTML.
    • A File Icon dynamically creates dummy syntaxes if a real syntax package is missing for various file types.
    • Theme - Monokai Pro recently started to ship such dummy syntaxes statically, known to create the kind of issues described by OP.
0 Likes

#4

I’m just opening a .html file. Never had this problem until recently.

0 Likes

#5

What I get is:
Syntax(‘Packages/Theme - Monokai Pro/syntaxes/markup_(html).sublime-syntax’, ‘markup (HTML)’, True, ‘text.html’)

0 Likes

#6

As I’m using Monokai Pro… how would I go about removing the dummy syntax so it can go back to correctly color coding HTML files?

0 Likes

#7

You probably want to upvote https://github.com/Monokai/monokai-pro-sublime-text/issues/178 and ask the package author for a solution.

0 Likes