Vscode-neovim: Buffer desync

Created on 29 Sep 2020  路  6Comments  路  Source: asvetliakov/vscode-neovim

Sometimes the contents of the buffer inside VSCode are different from the contents of Neovim.

Steps to reproduce:

  1. Install, for example, this extension.
  2. Navigate to the extension settings and click on "Edit in settings.json":
    懈蟹芯斜褉邪卸械薪懈械
  3. You will have desync. G does not move to the last line, exiting insert mode moves the cursor to the beginning of the file.

Note: the extension is just an example to 100% reproduce the issue. Desync can happen sometimes in a lot of other cases.


Log

log 2020-09-28T22:04:22.586Z BufferManager: onDidChangeVisibleTextEditors 2020-09-28T22:04:22.587Z BufferManager: onDidChangeActiveTextEditor 2020-09-28T22:04:22.637Z DocumentChangeManager: Change text document for uri: vscode-userdata:/home/gena/.config/Code%20-%20OSS/User/settings.json 2020-09-28T22:04:22.638Z DocumentChangeManager: Syncing document changes with neovim 2020-09-28T22:04:22.639Z DocumentChangeManager: Processing document vscode-userdata:/home/gena/.config/Code%20-%20OSS/User/settings.json 2020-09-28T22:04:22.639Z DocumentChangeManager: No diff ranges for vscode-userdata:/home/gena/.config/Code%20-%20OSS/User/settings.json, skipping 2020-09-28T22:04:22.640Z DocumentChangeManager: Change text document for uri: vscode-userdata:/home/gena/.config/Code%20-%20OSS/User/settings.json 2020-09-28T22:04:22.640Z DocumentChangeManager: Syncing document changes with neovim 2020-09-28T22:04:22.641Z DocumentChangeManager: Processing document vscode-userdata:/home/gena/.config/Code%20-%20OSS/User/settings.json 2020-09-28T22:04:22.642Z DocumentChangeManager: Change text document for uri: vscode-userdata:/home/gena/.config/Code%20-%20OSS/User/settings.json 2020-09-28T22:04:22.643Z DocumentChangeManager: Syncing document changes with neovim 2020-09-28T22:04:22.643Z DocumentChangeManager: Processing document vscode-userdata:/home/gena/.config/Code%20-%20OSS/User/settings.json 2020-09-28T22:04:22.644Z DocumentChangeManager: Change text document for uri: vscode-userdata:/home/gena/.config/Code%20-%20OSS/User/settings.json 2020-09-28T22:04:22.644Z DocumentChangeManager: Syncing document changes with neovim 2020-09-28T22:04:22.645Z DocumentChangeManager: Processing document vscode-userdata:/home/gena/.config/Code%20-%20OSS/User/settings.json 2020-09-28T22:04:22.649Z BufferManager: syncing active editor 2020-09-28T22:04:22.649Z BufferManager: Waiting for completing layout resyncing 2020-09-28T22:04:22.650Z DocumentChangeManager: BufId: 2, lineChanges: 1, tick: 7, skipTick: 8 2020-09-28T22:04:22.652Z DocumentChangeManager: BufId: 2, lineChanges: 1, tick: 7, skipTick: 8 2020-09-28T22:04:22.653Z DocumentChangeManager: BufId: 2, lineChanges: 1, tick: 7, skipTick: 8 2020-09-28T22:04:22.654Z DocumentChangeManager: Received neovim buffer changed event for bufId: 2, tick: 8 2020-09-28T22:04:22.654Z DocumentChangeManager: BufId: 2 skipping tick: 8 2020-09-28T22:04:22.655Z DocumentChangeManager: Received neovim buffer changed event for bufId: 2, tick: 9 2020-09-28T22:04:22.655Z DocumentChangeManager: Applying neovim edits 2020-09-28T22:04:22.655Z DocumentChangeManager: Accumulating edits for vscode-userdata:/home/gena/.config/Code%20-%20OSS/User/settings.json, bufId: 2 2020-09-28T22:04:22.661Z DocumentChangeManager: Applying edits for vscode-userdata:/home/gena/.config/Code%20-%20OSS/User/settings.json 2020-09-28T22:04:22.665Z DocumentChangeManager: Received neovim buffer changed event for bufId: 2, tick: 10 2020-09-28T22:04:22.687Z BufferManager: syncing layout 2020-09-28T22:04:22.688Z BufferManager: new/changed editors/windows 2020-09-28T22:04:22.688Z BufferManager: Visible editor, viewColumn: 1, doc: vscode-userdata:/home/gena/.config/Code%20-%20OSS/User/settings.json 2020-09-28T22:04:22.688Z BufferManager: Creating new neovim window for 1 column (undefined is OK here) 2020-09-28T22:04:22.695Z CursorManager: SelectionChanged 2020-09-28T22:04:22.696Z CursorManager: Waiting for possible layout completion operation 2020-09-28T22:04:22.696Z BufferManager: Waiting for completing layout resyncing 2020-09-28T22:04:22.710Z DocumentChangeManager: Change text document for uri: vscode-userdata:/home/gena/.config/Code%20-%20OSS/User/settings.json 2020-09-28T22:04:22.711Z DocumentChangeManager: Skipping a change since versions equals 2020-09-28T22:04:22.715Z CursorManager: Received cursor update from neovim, winId: 1004, pos: [0, 0] 2020-09-28T22:04:22.715Z CursorManager: No editor for winId: 1004 2020-09-28T22:04:22.716Z CursorManager: Received cursor update from neovim, winId: 1000, pos: [0, 0] 2020-09-28T22:04:22.716Z CursorManager: No editor for winId: 1000 2020-09-28T22:04:22.717Z BufferManager: Created new window: 1004 2020-09-28T22:04:22.718Z BufferManager: ViewColumn: 1 - WinId: 1004 2020-09-28T22:04:22.718Z BufferManager: Setting buffer: 2 to win: 1004, cursor: [102, 4] 2020-09-28T22:04:22.718Z BufferManager: Closing non visible editors 2020-09-28T22:04:22.719Z BufferManager: Waiting done 2020-09-28T22:04:22.719Z BufferManager: Waiting done 2020-09-28T22:04:22.719Z BufferManager: Setting active editor - viewColumn: 1, winId: 1004 2020-09-28T22:04:22.720Z CursorManager: Waiting for possible document change completion operation 2020-09-28T22:04:22.730Z CursorManager: Received cursor update from neovim, winId: 1004, pos: [101, 4] 2020-09-28T22:04:22.730Z CursorManager: Waiting for document change completion before setting the cursor, winId: 1004 2020-09-28T22:04:22.730Z CursorManager: Received cursor update from neovim, winId: 1000, pos: [0, 0] 2020-09-28T22:04:22.731Z CursorManager: No editor for winId: 1000 2020-09-28T22:04:22.735Z CursorManager: Received cursor update from neovim, winId: 1004, pos: [101, 4] 2020-09-28T22:04:22.736Z CursorManager: Waiting for document change completion before setting the cursor, winId: 1004 2020-09-28T22:04:22.736Z CursorManager: Received cursor update from neovim, winId: 1000, pos: [0, 0] 2020-09-28T22:04:22.736Z CursorManager: No editor for winId: 1000 2020-09-28T22:04:22.747Z DocumentChangeManager: Changes succesfully applied for vscode-userdata:/home/gena/.config/Code%20-%20OSS/User/settings.json 2020-09-28T22:04:22.747Z DocumentChangeManager: Accumulating edits for vscode-userdata:/home/gena/.config/Code%20-%20OSS/User/settings.json, bufId: 2 2020-09-28T22:04:22.748Z DocumentChangeManager: Applying edits for vscode-userdata:/home/gena/.config/Code%20-%20OSS/User/settings.json 2020-09-28T22:04:22.762Z DocumentChangeManager: Change text document for uri: vscode-userdata:/home/gena/.config/Code%20-%20OSS/User/settings.json 2020-09-28T22:04:22.763Z DocumentChangeManager: Skipping a change since versions equals 2020-09-28T22:04:22.786Z DocumentChangeManager: Changes succesfully applied for vscode-userdata:/home/gena/.config/Code%20-%20OSS/User/settings.json 2020-09-28T22:04:22.787Z CursorManager: Waiting done 2020-09-28T22:04:22.787Z CursorManager: kind: 3, WinId: 1004, cursor: [100, 4], isMultiSelection: false 2020-09-28T22:04:22.787Z CursorManager: Updating cursor pos, winId: 1004, pos: [103, 4] 2020-09-28T22:04:22.787Z CursorManager: Waiting document change completion done, winId: 1004 2020-09-28T22:04:22.787Z CursorManager: Updating cursor in editor, viewColumn: 1, pos: [101, 4] 2020-09-28T22:04:22.788Z CursorManager: Waiting document change completion done, winId: 1004 2020-09-28T22:04:22.788Z CursorManager: Updating cursor in editor, viewColumn: 1, pos: [101, 4] 2020-09-28T22:04:22.843Z CursorManager: SelectionChanged 2020-09-28T22:04:22.844Z CursorManager: Waiting for possible layout completion operation 2020-09-28T22:04:22.844Z CursorManager: Waiting for possible document change completion operation 2020-09-28T22:04:22.844Z CursorManager: Waiting done 2020-09-28T22:04:22.844Z CursorManager: kind: 3, WinId: 1004, cursor: [101, 4], isMultiSelection: false 2020-09-28T22:04:22.845Z CursorManager: Skipping event since neovim has same cursor pos

Most helpful comment

I am often getting cases where normal mode does not seem to be operating on the same file I am seeing on the screen.

For example, in normal mode, the cursor can be stuck at the top, hjkl does nothing. If I go into insert mode, cursor down, press escape then the cursor jumps back to the top and freezes again. If I do some undos then the cursor might be able to move a few lines down.

I am getting it on an untitled/unsaved file right now, but it has happened on saved files.

@asvetliakov Something is quite broken, does this sound like a buffer desync?

All 6 comments

I am often getting cases where normal mode does not seem to be operating on the same file I am seeing on the screen.

For example, in normal mode, the cursor can be stuck at the top, hjkl does nothing. If I go into insert mode, cursor down, press escape then the cursor jumps back to the top and freezes again. If I do some undos then the cursor might be able to move a few lines down.

I am getting it on an untitled/unsaved file right now, but it has happened on saved files.

@asvetliakov Something is quite broken, does this sound like a buffer desync?

image

I'm also seeing buffer de-sync. In these screenshot I'm forward searching for 'parent'. You can see the highlighted matches are one line off where they should be. This has only happened once, no-repro I'm afraid. Saving the file didn't help. But closing and reopening the buffer did.

I can reproduce this too on the latest build of the extension paired with nvim 0.5 git head.
Editing a simple CMakeLists file does it very, very consistently - insert mode does nothing, hjkl doesn't move the cursor and ESC jumps to the top of the file. Selecting text using the mouse, entering insert mode and typing however replaces the selected text with whatever is typed so it seems it's not a complete desync in some way..

[EDIT] - getting this on macOS 10.15

Yeah, this makes the extension unusable to me. Currently I use previous version before the major refactoring (#334) that do not have the issue with the latest vim-runtime files. Maybe someone will find it useful.
vscode-neovim-0.0.52.zip

Yeah, this makes the extension unusable to me. Currently I use previous version before the major refactoring (#334) that do not have the issue with the latest vim-runtime files. Maybe someone will find it useful.
vscode-neovim-0.0.52.zip

You can right click the extension and select "install another version" :D
image

@mizagog, sorry, forgot to mention, the version above is from a branch that draws labels for easymotion on top.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zeljkofilipin picture zeljkofilipin  路  3Comments

ppwwyyxx picture ppwwyyxx  路  4Comments

joshua7v picture joshua7v  路  4Comments

bogdan0083 picture bogdan0083  路  4Comments

pieterdd picture pieterdd  路  4Comments