diff options
author | Ibby <33922797+SleepySwords@users.noreply.github.com> | 2023-03-19 18:50:45 +1100 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2023-05-22 13:49:42 +0200 |
commit | 389f5ca39d278173dc0446dc339f7ac1ff573329 (patch) | |
tree | ee12b0af08dd008e98da8ab081bcf0dcb7464b83 /test | |
parent | 0e1f3b5acf74e82ea778f3c0871a804a9ae89d4e (diff) | |
download | rneovim-389f5ca39d278173dc0446dc339f7ac1ff573329.tar.gz rneovim-389f5ca39d278173dc0446dc339f7ac1ff573329.tar.bz2 rneovim-389f5ca39d278173dc0446dc339f7ac1ff573329.zip |
fix(ui): adjust the cursor when inserting virtual text
Credit to: Jesse Bakker
https://github.com/neovim/neovim/pull/20130#issuecomment-1369652743
Co-authored-by: Jesse Bakker <github@jessebakker.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/ui/decorations_spec.lua | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index d029a66301..94267e35c4 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -1272,6 +1272,32 @@ end]] | ]]} end) + + it('adjusts cursor location correctly when inserting around inline virtual text', function() + insert('12345678') + feed '$' + meths.buf_set_extmark(0, ns, 0, 4, + { virt_text = { { ' virtual text ', 'Special' } }, virt_text_pos = 'inline' }) + + screen:expect { grid = [[ + 1234{28: virtual text }567^8 | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + | + ]] + } + end) end) describe('decorations: virtual lines', function() |