Sublime Forum

firstLineMatch regex

#1

Question: is the firstLineMatch key active in tmLanguage files? I noticed that, when loading a LaTeX beamer file, with a \documentclass{beamer} command as the first line, the syntax is not switched to LaTeX Beamer, but plain LaTeX. Thanks!

0 Likes

#2

It is active, but it currently doesn’t take precedence over the file extension. You should be able to see it in action by pasting the text into a new file, which will also trigger the firstLineMatch based detection.

0 Likes

#3

I quick question: Are the file extensions still taking precedence over firstLineMatch? I did some test with Obj-C and Matlab files which share the extension ‘*.m’ and it does look like.

If yes, do you have any plans to change that?

Cheers
Thomas

0 Likes

#4

I too am having problems with my Matlab files being considered objective C. Incidentally, I tried deleting the objective C syntax directory and now by default Matlab is not highlighted at all.

0 Likes

#5

Hi if anyone has come across this problem and doesn’t use ObjC

The fix to this is to add the file extension Matlab.tmLanguage

and remove that from the Objc.tmLanguage file

0 Likes