How do I highlight the error lines in the Build Output Panel of Sublime Text 2? I have some lines in the output like this:
This is just a message
Warning: <C:\Path\File.ext:12> WarningMessage ORANGE
Error : <C:\Path\File.ext:34> ErrorMessage RED
How do I colour the Error and Warning lines? I have setup my custom .sublime-build "file_regex" key to detect them for doubleclick, but don't see how to style the matches.
This is possible. It takes a bit of work, but I have done it at least on Linux.
Copy the Packages/Default/exec.py to your User directory (or the Plugin directory if you are building a plugin). I changed the name of the .py file to correlate with the Build file, but I do not think this is strictly necessary.
Change the run method of the ExecCommand class to call your syntax file and color scheme. I added these around line 117 in the current build, just above the line that has:
self.output_view.settings().set("result_file_regex", file_regex)
I added in the following lines.
self.output_view.settings().set("color_scheme", "Packages/Color/Color.tmTheme")
self.output_view.set_syntax_file("Packages/Scheme/Scheme.tmLanguage")
Where Packages/Color/Color.tmTheme
is the color scheme definition file you are seeking and where Packages/Sheme/Scheme.tmLanguage
is the syntax definition file you are wanting to integrate.
Update your .sublime-build
file to call the custom file you modified above with the following call:
"target": ["Packages", "User", "NewExecFile.py"]
Note: The following will not work:
"target": ["Packages/User/NewExecFile.py"]
unless you were to update the NewExecFile.py to call the target
field without joining with file separators.
I'm on Linux, so you'd obviously need to update for windows. But it is working like a charm for me. I now have a build function which returns results that match the color scheme I use for development.
References:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With