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

trimOnSave doesn't work #21 reopened #65

Open
esemlabel opened this issue Jul 11, 2022 · 3 comments
Open

trimOnSave doesn't work #21 reopened #65

esemlabel opened this issue Jul 11, 2022 · 3 comments

Comments

@esemlabel
Copy link

esemlabel commented Jul 11, 2022

#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.

@shardulm94
Copy link
Owner

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.

@esemlabel
Copy link
Author

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.

@ltWolfik
Copy link

ltWolfik commented Apr 7, 2023

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.

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

No branches or pull requests

3 participants