diff options
author | luukvbaal <luukvbaal@gmail.com> | 2025-03-04 19:45:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-04 19:45:21 +0100 |
commit | 81ea44fa6aca27e6871d5baa158e2a5bcfa41981 (patch) | |
tree | 5730330d62637b7b04c5ca153b39e68256ad72ea /test/functional/plugin/lsp/utils_spec.lua | |
parent | 7d5866d471746ca68981e57884eaaeb8dea57f81 (diff) | |
download | rneovim-81ea44fa6aca27e6871d5baa158e2a5bcfa41981.tar.gz rneovim-81ea44fa6aca27e6871d5baa158e2a5bcfa41981.tar.bz2 rneovim-81ea44fa6aca27e6871d5baa158e2a5bcfa41981.zip |
fix(display): adjust winline info for concealed lines below last line (#32708)
Problem: Last line in a window does not store correct `wl_lastlnum` if
lines below it are concealed (resulting in e.g. incorrect
cursor row).
Solution: Increment `wl_lastlnum` while it points to a line above a
concealed line.
Diffstat (limited to 'test/functional/plugin/lsp/utils_spec.lua')
-rw-r--r-- | test/functional/plugin/lsp/utils_spec.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/functional/plugin/lsp/utils_spec.lua b/test/functional/plugin/lsp/utils_spec.lua index 75cc69bed4..683e2a7641 100644 --- a/test/functional/plugin/lsp/utils_spec.lua +++ b/test/functional/plugin/lsp/utils_spec.lua @@ -382,6 +382,24 @@ describe('vim.lsp.util', function() {1:~ }|*9 | ]]) + -- This tests the valid winline code path (why doesn't the above?). + exec_lua([[ + vim.cmd.only() + vim.lsp.util.open_floating_preview({ 'foo', '```lua', 'local bar', '```' }, 'markdown', { + border = 'single', + focus = false, + }) + ]]) + feed('<C-W>wG') + screen:expect([[ + | + ┌─────────┐{1: }| + │{4:foo }│{1: }| + │{100:^local}{101: }{102:bar}│{1: }| + └─────────┘{1: }| + {1:~ }|*8 + | + ]]) end) it('open_floating_preview height does not exceed max_height', function() |