Sublime Forum

Extra chars in build results, messing with file_regex?

#1

I’m trying to enhance the plugin for LESS (https://forum.sublimetext.com/t/plugin-request-less-css-converter/1263/1) to include error reporting, but I’m noticing some strange output in the build results. Using terminal and building the LESS file I get the following:

The "sys" module is now called "util". It should have a similar interface. Syntax Error on line 33 in /Volumes/CSA Chester County/wp-content/themes/csatheme/less/style.less 32 33 html, body { margin : 0; padding : 0; 2} 34

However when I run the build I get this in the window:

[code]The “sys” module is now called “util”. It should have a similar interface.
e[31mSyntax Error on line 33e[39me[31m in e[39m/Volumes/CSA Chester County/wp-content/themes/csatheme/less/style.less
e[90m32 e[39m
33 html, body { margin : 0; padding : 0; e[33me[1m2e[22m}e[39m
e[90m34 e[39me[0m

[Finished][/code]

Where are the extra characters coming from? Do I need to worry about them in the regex? I can’t for the life of me get a valid file_regex and line_regex going and I’m wondering if they might be causing my trouble.

Edit: I’m thinking it might be the color information node.js is sending back for the error string?

0 Likes

#2

In some terminals, you can specify colors with a special notation. That is what I believe you’re seeing. Those extra characters are trying to specify color for the following text. The “” lets the terminal know that the next number is the color, but since you are outputting it into an environment that does not handle that notation, you just get the extra characters.

0 Likes

#3

Ah, thanks, looks like I need the -no-color options for lessc.

Question 2: for file_regex, is there a way to re-order the matches? I assume Sublime expects filename first, but in this case it’s the last item on the line.

0 Likes

#4

I don’t believe there’s a way to reorder the matches, at least according to boost.org/doc/libs/1_38_0/li … yntax.html

0 Likes

#5

So then there’s no way to parse the above error message, since line_regex only gets called if file_regex doesn’t hit (which it would).

0 Likes