From e31bfb81ce796a8384eaebbf3f5a7184eebf153d Mon Sep 17 00:00:00 2001 From: Yi Ming Date: Wed, 1 Apr 2026 00:31:30 +0800 Subject: [PATCH] fix(lsp): use `winresetview()` to avoid switching to normal mode (#38641) --- runtime/lua/vim/lsp/codelens.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/lua/vim/lsp/codelens.lua b/runtime/lua/vim/lsp/codelens.lua index 30b4c4a8ca..66d7a0cab4 100644 --- a/runtime/lua/vim/lsp/codelens.lua +++ b/runtime/lua/vim/lsp/codelens.lua @@ -272,7 +272,7 @@ function Provider:on_win(toprow, botrow) -- Fix https://github.com/neovim/neovim/issues/16166 -- Make sure the code lens on the first line is visible when updating. if row == 0 then - vim.cmd('normal! zb') + vim.fn.winrestview({ topfill = 1 }) end end self.row_version[row] = self.version