Skip to content

fixed format on save not always being done#9895

Merged
J-Fields merged 1 commit intoVSCodeVim:masterfrom
teslae1:fixes_formatonsave_not_always_being_done
Mar 27, 2026
Merged

fixed format on save not always being done#9895
J-Fields merged 1 commit intoVSCodeVim:masterfrom
teslae1:fixes_formatonsave_not_always_being_done

Conversation

@teslae1
Copy link
Copy Markdown
Contributor

@teslae1 teslae1 commented Jan 9, 2026

What this PR does / why we need it:
Fixes format on save problem.
I was able to reproduce the problem using the video from the issue,
but also found a more reliable way of reproducing it:

  • create a file that needs formatting on disk
  • open the file in vscode
  • have the 'editor.formatOnSave' setting toggled
  • without changing any text of the file do ':w'
  • won't format
  • do ctrl + s
  • will do format

The problem is that vscode won't do format on save when calling 'vimState.document.save()' if the textual contents is no different from disk (document not 'dirty').

Which issue(s) this PR fixes
#9883

@teslae1 teslae1 changed the title fixed format on save on always being done fixed format on save not always being done Jan 11, 2026
Copy link
Copy Markdown
Member

@J-Fields J-Fields left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@J-Fields J-Fields merged commit 1bfb380 into VSCodeVim:master Mar 27, 2026
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

Successfully merging this pull request may close these issues.

2 participants