Sublime Forum

Syntax highlighting stops halfway down

#1

I use sublime for editing text files that are a unique language for a business application we use. Its based on Java so I’ve set sublime to treat .txt files as java. Now about halfway down the file the syntax highlighting stops and after this the text is all white and the variable auto-completion stops working.

Any ideas?

0 Likes

#2

No idea, but always when you report, tell which version you are using. And on which platform. And if you have some packages installed. A sample input file and screenshot would be cool too.

0 Likes

#3

The highlight can stop when there is too many scope: this can happen with buggy syntax that starts a scope but never get out. Check your scope (ctrl+alt+shift+p) just before the highlight break and you might see one scope repeating over and over again.

1 Like

#4

This is an old thread, but for anyone wondering why their Java syntax highlighting stops midway in a document, I found putting a semi-colon ( ; ) at the end of a line that didn’t have one fixed the situation. It essentially ended the previous scope and started a new one. In my case, I was using Java syntax highlighting for a “near-java” scripting language which didn’t require semi-colons at the end of lines. Adding one did the trick for me and was accepted by the scripting language.

I derived this simple solution in my (unique) case from the comments made by @Clams about scopes.

1 Like