vscode-trailingspaces
vscode-trailingspaces copied to clipboard
trimOnSave doesn't work #21 reopened
#21 It kind of work but not completely.
It did trim only modified lines, but once I revert changes back to original state by hitting cmd+z or "Revert change" from popup, it still conciders those line changes as mine and I'm no longer able to save file without triming that line. The only way to skip trimming is to run git reset on file.
Can you elaborate more with some examples of your scenario?
Based on what I understand till now, this issue not really related to #21, which was more about deleteModifiedLinesOnly not identifying some lines as modified.
I think the behavior you see is expected. deleteModifiedLinesOnly identifies the lines you have changed since the last save and trims only those lines. Using Ctrl + Z to revert changes is also one way of modifying files. So I would expect it to trim the lines reverted manually in the editor.
I undertand. Maybe my explanation isn't ideal, but anyway, it still triggers trim even though I undo my changes. So I would commit changes that I didn't intend to commit just because I ever touch that line.
I have the next trailing-spaces config:
{
"trailing-spaces.highlightCurrentLine": false,
"trailing-spaces.trimOnSave": true,
"trailing-spaces.deleteModifiedLinesOnly": true
}
I'm noticed that sometimes spaces survive at the end of line. Do not know exactly why. Some way extension does not consider some modified lines to be modified.