Sublime Forum

Why did my syntax error flags in lines vanish?

#1

As shown below, I had red syntax error flags in lines before.
20220213163158
And now, they just vanished.
https://s4.ax1x.com/2022/02/13/HDvbrj.png(Sorry, new users can only put one image in a post.)
I don’t know what I did to lose them. I also checked the Preferences Settings and set the “show_errors_inline” as true but found it in vain.
https://s4.ax1x.com/2022/02/13/HDvqqs.png
So what’s the matter?
I am just a newbie. If this question is too simple to post, I feel very sorry.
It would be immensely appreciated if you helped with me.:slight_smile:

0 Likes

#2

show_errors_inline is the correct setting to enable that, however:

  1. The sublime-build file that you’re using needs to be using the standard exec command (that is, the key target cannot appear in the file)
  2. The sublime-build file needs to include a file_regex (and depending on the language in use, line_regex as well) that matches error output so that Sublime can capture errors for display

The C Single File and C++ Single File build systems that ship with Sublime both fall into this category, so the errors would work there.

If however you use a third party package as a part of your builds, such as Terminus for interactive builds or something to colorize the build output, then those would be using a target key to change the build, which blocks the error handling used here.

Alternatively, it is very common for C/C++ users of Sublime to follow instructions on the web to set up builds for those languages following other conventions (e.g. for competetive coding or the like) and usually those instructions create builds that can’t track errors because they lack the regex keys that allows Sublime to detect errors in the tool output.

1 Like