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

Bug: trimOnSave does not always work with VSCode setting "files.autoSave": "onFocusChange" #76

Open
the-chenergy opened this issue May 6, 2024 · 0 comments

Comments

@the-chenergy
Copy link

Summary

The trailing-spaces.trimOnSave option normally works well with VSCode's auto-save feature. However, it does not work with the auto-save feature set to onFocusChange and you change input focus by switching to another editor in the same VSCode window, and whitespaces are not removed.

Reproduction

  1. Ensure your VSCode User Settings contain both of the following:
    "trailing-spaces.trimOnSave": true,
    "files.autoSave": "onFocusChange",
  2. Add some trailing whitespaces to the file in the current editor
  3. Focus something other than the current editor but leaving the current editor open; for instance, focus another window (Google Chrome or a different VSCode window)
    • Observe that the trailing whitespaces you added did get removed correctly
  4. Add some trailing whitespaces again in that editor
  5. Switch to a different tab in the same VSCode window
    • Go back to that tab again and observe that the trailing whitespaces you added did not get removed
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

1 participant