VSCodeVim / VSCodeVim/Vim

VS Live share undo affects multiple users

Open
#3,759 3 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
When two people (U1 and U2) share a VSCode session and both use the vim plugin. When U1 presses u while U2 is in insert mode, then everything U2 did dissapears as well. If U2 exits insert mode and presses <C-r>, then it will be impossible to recover the lost text.

To Reproduce
Steps to reproduce the behavior:

  1. U1, U2 in insert mode, both write something
  2. U1 exits insert mode, U2 still in insert mode
  3. U1 presses u to undo their recent changes

Now, everything U2 has written will dissapear as well

  1. U2 presses to exit insert mode
  2. U2 presses to redo the previous undo

Behaviour: What U1 did will be recovered, but what U2 did will not be recovered. This happens since U2, entered and exited insert mode without making any changes, it will be impossible to recover their lost work.

Workaround:

  1. U1 presses <C-r> before U2 exits insert mode

Expected behavior
When U1 presses u, then only what U1 wrote should dissapear.

Environment (please complete the following information):

Visual Studio Code
Version: 1.32.3 (system setup)
Commit: a3db5be9b5c6ba46bb7555ec5d60178ecc2eaae4
Date: 2019-03-14T23:43:35.476Z
Electron: 3.1.6
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.17134

Live Share
Name: Live Share
Id: ms-vsliveshare.vsliveshare
Description: Real-time collaborative development from the comfort of your favorite tools.
Version: 1.0.181
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare

Vim
Name: Vim
Id: vscodevim.vim
Description: Vim emulation for Visual Studio Code
Version: 1.8.0
Publisher: vscodevim
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=vscodevim.vim

  • Extension (VsCodeVim) version:
  • VSCode version:
  • OS:

Additional context
One user on windows, one on Ubuntu. Ubuntu laptop shared the session, not sure of its exact setup.

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 shared-session scenario with VS Code, Live Share, and VSCodeVim using the reported steps, checking how undo and redo behave when both users edit concurrently. Done means that pressing undo removes only the initiating user's changes and the other user's text remains recoverable with redo.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.