Skip to content

Create an undo stop when alternating between constructive edits, destructive edits, and cursor navigation #29036

@axefrog

Description

@axefrog
  • VSCode Version: 1.13.0
  • OS Version: Windows 10

VSCode's undo behaviour seems unusually coarse and not in line with how other editing experiences work. Often I accidentally hit the wrong key while something is selected and accidentally overwrite what I'd written. Then when I hit undo, it undoes not only what I just did, but a whole lot of what I'd done previously. Undo is supposed to save the user from these sorts of problems.

Steps to Reproduce:

  1. Type some words
  2. Delete the last word
  3. Type some more words
  4. Decide you don't like your change and hit undo

The entire sentence vanishes.

Undo stops should occur (roughly) in the following scenarios:

  • When starting a new destructive operation (backspace, delete, cut, etc.) after a constructive operation (typing, pasting, other insertion scenarios).
  • The inverse of the above; starting a new constructive operation after a destructive operation.
  • Between different classes of destructive or constructive edit - for example if I backspace a few times, removing characters left of the cursor, and then use the delete key, removing characters to the right of the cursor, I'd expect an undo stop to occur when the delete key is first pressed.
  • Starting to navigate and/or select text with the cursor after any kind of edit, or starting an edit operation after navigating with the cursor.

Metadata

Metadata

Assignees

Labels

editor-coreEditor basic functionalityfeature-requestRequest for new features or functionalityverification-neededVerification of issue is requestedverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions