Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailing spaces highlighted on all lines but the first #111

Closed
hsandt opened this issue Nov 23, 2016 · 0 comments · Fixed by #137
Closed

Trailing spaces highlighted on all lines but the first #111

hsandt opened this issue Nov 23, 2016 · 0 comments · Fixed by #137

Comments

@hsandt
Copy link

hsandt commented Nov 23, 2016

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.

@rchl rchl closed this as completed in #137 Apr 2, 2020
rchl added a commit that referenced this issue Apr 2, 2020
)

Pass all selection regions to `view_find_all_in_regions` and match
trailing spaces in the so that we can exclude them all when
`trailing_spaces_include_current_line` is `false`.

Also renamed some variables for clarity and use more concise code.

Resolves #111
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant