From 706ec4443a33ec474f2329b5b806e9cdb85cce43 Mon Sep 17 00:00:00 2001 From: Theo Lemay <16546293+theol0403@users.noreply.github.com> Date: Sun, 19 Oct 2025 06:31:48 -0400 Subject: [PATCH] fix(vscode): don't sync undo/redo with vscode (#5957) ## Description Vscode-neovim maintainer here, https://github.com/LazyVim/LazyVim/pull/4983 should not have been merged, it creates more problems than it solves. For the longest time I was trying to figure out why undo is broken on my machine, didn't notice this slipped in. The fundamental issue is that vscode's undo points are based on a time-based heuristic, wheras neovim's undo points are based on atomic actions (delete, insert, etc). Vscode doesn't understand the context of what the user is doing, it just receives a stream of edits from neovim. Ultimately this results in multiple unrelated edits being undone with a single press of the u key, resulting in very confusing behavior. ## Related Issue(s) https://github.com/LazyVim/LazyVim/pull/4983 ## Screenshots Current https://github.com/user-attachments/assets/5ca33b0d-fe2e-49f9-aa17-66f3c42c0966 Expected https://github.com/user-attachments/assets/d577a1f3-efb2-4725-be50-bd0cf691252d ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. Co-authored-by: Theo Lemay --- lua/lazyvim/plugins/extras/vscode.lua | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lua/lazyvim/plugins/extras/vscode.lua b/lua/lazyvim/plugins/extras/vscode.lua index 5115a2b4..92b7f9f0 100644 --- a/lua/lazyvim/plugins/extras/vscode.lua +++ b/lua/lazyvim/plugins/extras/vscode.lua @@ -39,10 +39,6 @@ vim.api.nvim_create_autocmd("User", { vim.keymap.set("n", "/", [[lua require('vscode').action('workbench.action.findInFiles')]]) vim.keymap.set("n", "ss", [[lua require('vscode').action('workbench.action.gotoSymbol')]]) - -- Keep undo/redo lists in sync with VsCode - vim.keymap.set("n", "u", "call VSCodeNotify('undo')") - vim.keymap.set("n", "", "call VSCodeNotify('redo')") - -- Navigate VSCode tabs like lazyvim buffers vim.keymap.set("n", "", "call VSCodeNotify('workbench.action.previousEditor')") vim.keymap.set("n", "", "call VSCodeNotify('workbench.action.nextEditor')")