Home Download Buy Blog Forum Support

Bug report: the file_regex in the Make Build System is wrong

Bug report: the file_regex in the Make Build System is wrong

Postby madadam on Fri Nov 30, 2012 11:37 am

Hello there,

The file_regex in the Make Build System (in $SUBLIME_DIR/Packages/Makefile/Make.sublime-build) is subtly wrong and it sometimes breaks the Next Result/Previous Result commands. The problem is, the regex matches more than it should. For example, in the project I'm currently working on, the makefile sometimes produces output like this:

Code: Select all
o src/Foo.cpp
o src/Bar.cpp
src/Bar.cpp: error: something something error...


The file_regex being this:

Code: Select all
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$"


so the first capturing parentheses will match o src/Bar.cpp\nsrc/Bar.cpp. It will then try to interpret it as a file path which is invalid, so the Next Result / Previous Result commands won't work. The fix is simple, just tell the regex to not match newlines:

Code: Select all
"file_regex": "^(..[^:\n]*):([0-9]+):?([0-9]+)?:? (.*)$"


That way it will correctly match only src/Bar.cpp in the above example.
madadam
 
Posts: 3
Joined: Fri Nov 30, 2012 11:15 am

Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Hashirama Senju and 21 guests