-
-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: VSCode and Nvim buffers get out of sync + general unwanted behavior #1624
Comments
I don't think the bug is fully resolved yet (v1.1.4) @xiyaowong . However, it is very specific to the keybinding I described in the original post (which is there to keep indentation after leaving insert mode without typing anything after using 'o').
Expected behavior:
Actual behavior:
The full new line is deleted. This only happens with the remap
You then can't move the cursor with |
It would be best to provide a screencast. |
I deactivated everything but the keybinding shown for 'o' from my init.lua. I also have the default I typed 'asdf', then hit <ctrl+h>. That removed the whole line instead of just the last character. record4.mp4Edit2: Not pretty, but it works now I guess. |
2nd case: record.mp4 |
Not sure, I can't reproduce it Please test this build |
With the remap for |
FYI I rolled back to vscode-neovim version 0.9.1 and the custom keybinds are working just fine again. At least I feel like that confirms that it's a bug and not on my end. Not sure why you can't reproduce it though... Another issue I found now is repeating a |
Unfortunately, it's still not working :( Thank you so much for trying to fix the issue though! I really appreciate it. Can I do anything to help you reproduce the issue? I also hoped to narrow the issue further by testing versions, it appears to be introduced with the 1.0.0 release. I'm not sure if that's any help. The repeat with |
I can confirm on mac that I've had this issue since the 1.0 release. So far I'm back to the 0.9x versions and haven't had problems so far. |
I can also confirm on macOS. I've tried using the VScode undo buffer instead of Neovim undo tree extension, and turning off all Neovim extensions and nothing has stopped the issue. It is irregular and thus difficult to reproduce but it's there. I have to reload vscode to access certain lines that, although displayed, seem to be unreachable by the cursor and I also lose entire lines of code out of the blue several times a day. I agree with @jackvividseats that it seems to have started happening in the last month or so, I'll be trying 0.9x version until this gets resolved. Thanks for the pointer. I'm happy to send something that could help with the debugging process if need be. One way I have been able to more regularly recreate this bug is in a markdown document, specifically adding the tick ` character when it autocompletes to be 6 ticks total for a code block. My cursor often can't access those ticks. |
I am also having a lot of sync issues between vscode and nvim since the latest update.. Which version is the working one now @spacian ? |
Experiencing the same issue where you cannot move the cursor on some lines, it is just stuck at the beginning of the line a lot of the times and I have to reload VSCode |
I have no issues at all with version 0.9.1. I.e. the issues I showed only appear when I use the following keybindings for -- my_lua_keybindings.lua
vim.keymap.set({'n'}, 'o' , 'o.<backspace>', {noremap=true})
vim.keymap.set({'n'}, 'O', 'O.<backspace>', {noremap=true}) Otherwise, the current version works fine for me. I had an issue with neovim not recognizing new lines in a file once in 1.4, but I couldn't reproduce the issue so far. Might be related, might not be. |
@spacian |
@theol0403 Oh that was was a misunderstanding on my end, I'm very sorry :( I did not read Updated the bug, although it probably caused a lot of confusion already <.< |
It's ok I also didn't notice you provided that binding in your original issue anyway. I'm happy it's not a sync issue by default, but maybe there is a solution still. |
to bump this, i don't have any of the bindings mentioned above, but am still encountering these issues. My keybinds are listed below if that helps.
|
@jackvividseats What issues do you encounter exactly? I wanted to try some of your bindings because I didn't know them. For me nvim seems to jump to empty buffers in the background when there is no next or previous buffer to go to anymore. It seems to be exactly 1 empty buffer, you can go further and it wraps around, or you can go back as well. VSCode probably doesn't have the empty buffer, but once it finds the buffers nvim is requesting, everything is working again. If that's what you're experiencing, it's probably unrelated to what I'm describing and I'd recommend opening another issue or using vscode's |
@spacian same issues as described above. The cursor visible in vscode is not synced with where it is in neovim. Motions move it to very different places than it should be. I don't have this issue, even when not using window change commands. For whatever reason, the 0.9xx versions don't have this issue (but have some of their own) |
@jackvividseats okay if you have the issue without using |
This is a very big issue, for me it happens randomly when I accept any completion suggestion from vscode or copilot. Buffers get out of sync, the only way to fix it is to close the buffer and reopen it, which is very annoying. To this point I even stopped using VSCode, I love vim motions, this extension was great but now it is unusable for me :( |
This comment was marked as duplicate.
This comment was marked as duplicate.
I don't want to jinx it, but I updated neovim with homebrew. While the version that displays when I run tagging |
Sounds a bit anecdotal :P but me too not having issues anymore as of late
…On Fri, 3 May 2024, 22:51 jackvividseats, ***@***.***> wrote:
I don't want to jinx it, but I updated neovim with homebrew. While the
version that displays when I run nvim -v is the same as before, I no
longer run into these issues after the neovim update.
tagging
@Dandarprox <https://github.com/Dandarprox> @vlrevolution
<https://github.com/vlrevolution> hopefully it helps with your issues.
—
Reply to this email directly, view it on GitHub
<#1624 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQC2ZKSCY53A53JQACM3GHTZAPTC7AVCNFSM6AAAAAA7N75436VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJTGY3DSNBYHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I just jinxed myself it seems, I think the common thread is when there's errors in the file for a while, when errors aren't in the file for too long, I haven't been getting issues. |
Here's the file where motions break for me, wondering if anyone can reproduce it. There's a line where motions simply don't work.
|
Did you check docs and existing issues?
Neovim version (nvim -v)
0.9.0
Operating system/version
Windows 10 - 22H2
Describe the bug
After the update to VSCode Neovim v1.0.1, the buffers of neovim and vscode regularly get out of sync. I think it also happens through stuff like auto formatting, but neovim also manages to do so all by itself.
The remap I added was for a purpose I don't remember right now, I think it had to do with cursor positions after using 'o' or so... but it worked in the last release of the extension, so I'll use it as an example.
Steps To Reproduce
vim.keymap.set({'n'}, 'o', 'o.<backspace>', {noremap=true})
Expected Behavior
I expect the file to look like this afterwards (with * showing the current cursor position):
I should have 3 lines and the last character typed, the ';', should be deleted. The cursor should be at the end of the file.
Instead, the file looks like this:
There are only 2 lines. The cursor is at the start of the file, the first typed line is removed completely. The second line is still there completely.
Additionally, the cursor won't move with hjkl commands because nvim thinks the file is empty. If I click anywhere on the second line, I get the error
nvim_win_set_cursor: Cursor position outside buffer
The text was updated successfully, but these errors were encountered: