SublimeText / TrailingSpaces

Highlight trailing spaces and delete them in a flash.
MIT License
897 stars 94 forks source link

Trailing spaces highlighted on all lines but the first #111

Closed hsandt closed 4 years ago

hsandt commented 7 years ago

When highlighting trailing spaces, they are ignored on the current line as expected, but when using multi-caret / multiple selection, trailing spaces on lines beyond the first one (from top to bottom, not by selection order) are still highlighted.

The error comes from trailing_spaces.py, in find_trailing_spaces: sel = view.sel()[0] only refers to the top-most selection. I think we should iterate on all selected regions instead, as Whitespace does in https://github.com/randy3k/Whitespace/blob/master/Whitespace.py

Note: I use TrailingSpaces for highlighting and Whitespace for trimming.