Ale: Add option to highlight lines with errors

Created on 11 Nov 2016  路  12Comments  路  Source: dense-analysis/ale

This would, in essence, serve as an alternative to signs. The gutter can be pretty obtrusive, but with signs disabled there's no quick visual cue to let you know where errors are. Ideally the colors for highlighting would be configurable for both errors and warnings, but have sensible defaults.

As an aside, I've just started using Ale, and so far I love it. This is the only feature I miss from Syntastic.

enhancement

Most helpful comment

I have now documented every highlight group.

All 12 comments

I had considered this from the start. The way to do this is to set special syntax rules which are created with lines and columns. It requires a bit of work.

Would this also enable column highlighting?

It would let you draw something on the word with the error.

I have implemented basic error highlighting now. For the moment, only a single character at the column will be highlighted for all linters. Some linters will have to specify some more information in future to be able to highlight words, etc.

Nice! Would it be possible to, say, underline the whole line where there's an error, instead just one char? How could I do it? Thank you!

I recommend setting a line highlight for the sign highlights. You can set this, for example.

highlight link ALEErrorLine error

Then all lines which have error signs will turn red. There's also ALEWarningLine and ALEInfoLine, although there are no "info" problems at the moment.

Ah, perfect! That's what I was looking for! Couldn't find it in the docs! Thanks.

Thanks, this is great. You should add the line highlight groups to the docs, though.

Good work!

I have now documented every highlight group.

Is it possible to disable gutter but continue to use ALEErrorLine?

At the moment, no. The line highlights come from the signs.

To support that, ALE would have to use matchaddpos to set the line highlights when signs are off. I'll open an issue for that.

741 There's the issue for that.

Was this page helpful?
0 / 5 - 0 ratings