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

Trim trailing whitespaces on line with cursor when explicitly saving #466

Closed
gwynjudd opened this issue Nov 23, 2015 · 9 comments
Closed
Assignees
Labels
feature-request Request for new features or functionality verified Verification succeeded
Milestone

Comments

@gwynjudd
Copy link

I have this set in my settings.json:

image

But after saving a file containing some trailing whitespace, it doesn't get trimmed:

image

@gwynjudd
Copy link
Author

A better screenshot:

image

I expected it would remove the whitespace after the ';' at the end of the line.

@bpasero
Copy link
Member

bpasero commented Nov 23, 2015

It works but not on the line the cursor is on because in that case we do not know if you want to continue typing after the whitespace.

@bpasero bpasero closed this as completed Nov 23, 2015
@thegiantbeast
Copy link

@bpasero so shouldn't the editor have one more option to define that?

@bpasero
Copy link
Member

bpasero commented Nov 27, 2015

@thegiantbeast we cannot really offer such an option because when auto save is enabled, the save can kick in anytime (currently 1 second after making a change) and you would not be able to type whitespace after the end of a line and continue typing.

@thegiantbeast
Copy link

That doesn't sound complex, as long as you differentiate a save from auto save (where the white spaces are not trimmed) and when the user actually saves a file, no?

It's because it's really annoying that I have to remember to delete the spaces in the line that I'm in.

@bpasero bpasero added the feature-request Request for new features or functionality label Nov 27, 2015
@bpasero bpasero reopened this Nov 27, 2015
@bpasero
Copy link
Member

bpasero commented Nov 27, 2015

@alexandrudima fyi

@bpasero bpasero changed the title The user setting files.trimTrailingWhitespace doesn't seem to work Trim trailing whitespaces on line with cursor when explicitly saving Nov 27, 2015
@alexdima
Copy link
Member

@bpasero 👍
I like the idea: an explicit ctrl+s should trim everything, a background auto-save should keep doing what its doing now.

@bpasero bpasero closed this as completed in 055168d Dec 2, 2015
@bpasero bpasero added this to the Dec 2015 milestone Dec 2, 2015
@bpasero bpasero self-assigned this Dec 2, 2015
@alexdima
Copy link
Member

alexdima commented Dec 2, 2015

👍 This is great! Thank you!

@bpasero
Copy link
Member

bpasero commented Dec 2, 2015

❤️

@bpasero bpasero added the verified Verification succeeded label Apr 29, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants