Skip to content

files.trimFinalNewlines unnecessarily adds extra event to undo history #46075

@garyking

Description

@garyking

This was also discussed in #39750 and apparently fixed in #39845, but I'm still experiencing this.

Steps to reproduce:

  1. Set files.trimFinalNewlines to true in settings.
  2. Create a file, and add the following contents:
Test

Ensure that there's an empty newline at the end. Save it. Then hit Undo. Nothing will happen. Hit Undo again, then it will work as expected.

You can even hit Save multiple times, and each time will add one extra step to the Undo list. So hit Save 10 times, then you can hit Undo 10 times and nothing will happen.

@AiryShift Could you take a look at this if possible?

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions