Home Download Buy Blog Forum Support

firstLineMatch regex

firstLineMatch regex

Postby Marciano on Mon Apr 04, 2011 3:03 pm

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!
Posts: 146
Joined: Fri Sep 18, 2009 2:55 am

Re: firstLineMatch regex

Postby jps on Tue Apr 05, 2011 11:30 am

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.
Site Admin
Posts: 3217
Joined: Wed Mar 19, 2008 12:33 pm

Re: firstLineMatch regex

Postby mrtom on Sun Apr 01, 2012 1:09 pm

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?

Posts: 1
Joined: Sun Apr 01, 2012 1:02 pm

Re: firstLineMatch regex

Postby rob on Thu Apr 05, 2012 2:19 pm

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.
Posts: 5
Joined: Thu Apr 05, 2012 1:21 pm

Re: firstLineMatch regex

Postby chid on Wed Jul 04, 2012 2:54 am

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

<!-- Actually, it's generally .m, but that's taken by Objective-C. It needs an entry to show up in the syntax list. -->

and remove that from the Objc.tmLanguage file
Posts: 4
Joined: Wed Jul 04, 2012 2:51 am

Return to Technical Support

Who is online

Users browsing this forum: No registered users and 16 guests