-
Notifications
You must be signed in to change notification settings - Fork 30
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
Removing of trailing whitespace happens for selected lines, not all lines #57
Comments
Do you have a reference? This kind of drastic API change is a bit unusual... |
Reference: Notepad++ user manual, https://npp-user-manual.org/docs/editing/#edit-menu |
Thanks for the reference. I think cancelling an active selection before saving should do the job. But I haven't look at it in much depth yet. |
It would, but doing it really well would involve:
That can actually be somewhat complicated. To me, it would be okay to just cancel any active selections and not worry about restoring them. |
For me, just clearing the selection is the most logical choice. That is just one line of code. And with the possibility in N++ to use multiple selections it indeed could become complicated. Would you always clear the selection when saving, or just when a trim trailing spaces should be executed? |
IMO always clearing the selection is probably fine. |
A change was introduced, I believe it was in Notepad++ 8.4.9, that causes its command for "Trim Trailing Space" to only do that operation on selected text lines (if some selection is active at the time the command is executed), not on the entire file (as was behavior before 8.4.9).
This will cause editorconfig, which I believe invokes that command, to not do the editorconfig "spec" thing when some text is selected at the time of file save. Thus, one could have editorconfig configuration set to remove trailing space, have a selection active, save, and see lines that are not in the selected text region NOT have their trailing whitespace removed.
Using editorconfig for Notepad++ ver 0.4.0.0.
The text was updated successfully, but these errors were encountered: