diff options
| author | Yi Ming <ofseed@foxmail.com> | 2026-02-20 19:33:20 +0800 |
|---|---|---|
| committer | Yi Ming <ofseed@foxmail.com> | 2026-03-08 11:32:50 +0800 |
| commit | 40dc2d02a85175339ce70611764b0bde7b1c19f4 (patch) | |
| tree | cd50dcf909ab07f1ebf102ae27a5065f5dfebcd3 /runtime/lua/vim/lsp/codelens.lua | |
| parent | 378435968f64b681cb9a16d8ebf966e5d472e3fc (diff) | |
| download | rneovim-40dc2d02a85175339ce70611764b0bde7b1c19f4.tar.gz rneovim-40dc2d02a85175339ce70611764b0bde7b1c19f4.tar.bz2 rneovim-40dc2d02a85175339ce70611764b0bde7b1c19f4.zip | |
fix(lsp): ensure the codelens on the first line is visible
Diffstat (limited to 'runtime/lua/vim/lsp/codelens.lua')
| -rw-r--r-- | runtime/lua/vim/lsp/codelens.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp/codelens.lua b/runtime/lua/vim/lsp/codelens.lua index 63688b96d0..a2639f3397 100644 --- a/runtime/lua/vim/lsp/codelens.lua +++ b/runtime/lua/vim/lsp/codelens.lua @@ -259,6 +259,12 @@ function Provider:on_win(toprow, botrow) virt_lines_overflow = 'scroll', hl_mode = 'combine', }) + + -- 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') + end end self.row_version[row] = self.version end |