-
Notifications
You must be signed in to change notification settings - Fork 24
Description
The extension is failing so badly that it is completely unusable for me. I'm using these non-default settings:
"trailing-spaces.trimOnSave": true,
"trailing-spaces.deleteModifiedLinesOnly": true,
When I save a file, I expect the extension to remove all trailing spaces on lines modified since the last save. And I expect the spaces to be removed immediately before the file is saved, so the end result is actually saved.
However, what actually happens is that trailing spaces in very few (sometimes none) of the modified lines are trimmed. And the trimming happens after the save, so I have to save again to save the trimmed result.
Steps to reproduce:
- Create a new file with 'a' on the 1st line, 'b' on the 2nd, and nothing on the 3rd, and save this file.
- Add a space at the end of each of the first 2 lines, and place the cursor on the 3rd line.
- Save the file.
Most frequent result: The file is saved without any trimming (verify this with another editor), then the space on the 1st line - but not the 2nd - is removed, and the editor is now in "unsaved" state. I was expecting both spaces to be removed and this change to be included in the saved file, so the editor would end up being in "saved" state after the save.
Same thing with all other extensions disabled.
Trailing Spaces 0.2.11
VSCode 1.27.2
Windows 10 on 2 different machines (also with VSCode 1.26.1 on a Debian Linux machine).
Update (2019-04-14):
The latest Trailing Spaces 0.3.1 appears to save the trimming and does not leave the editor in "unsaved" state, so that's an improvement. But it still doesn't trim all the modified lines (the steps above still leave the 2nd line untrimmed).