VSCodeVim / VSCodeVim/Vim

Refactoring command does not count as one action for undo, undoing the next command reverts all refactoring.

Open
#2,972 1 comment 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

Describe the bug
Refactoring command does not count as one action for undo.
Undoing the next command reverts all refactoring.

To Reproduce

  1. Try to rename symbols like a variable name in your project with F2
  2. o -> type something -> exit edit mode
  3. Press u to undo. The line disappears as it should but it also reverts all the refactoring.
  4. Using redo will redo all the refactoring and including the added line. There is no way to go to the state after refactoring and before adding the line using undo/redo.

Environment (please complete the following information):

  • Extension Name: vim
  • Extension Version: 0.16.0
  • OS Version: Darwin x64 17.7.0
  • VSCode version: 1.26.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the sequence using F2 to rename symbols, then insert a line with o, exit edit mode, and press u followed by redo. Start by tracing how refactoring and subsequent editing are recorded in the undo history; done means undo removes only the inserted line and another undo reaches the state before refactoring, with redo restoring each step separately.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.