diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-02-12 21:24:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-12 21:24:28 +0800 |
commit | 2d9e063a63f8af7eb9e8321c4845ec4f077ccf58 (patch) | |
tree | fb83cdefeccd710ae3545053fe59ffee430556c2 /test/functional/ui/decorations_spec.lua | |
parent | 597ecf751603cde2d5f58021d503ae20a12eb2f2 (diff) | |
download | rneovim-2d9e063a63f8af7eb9e8321c4845ec4f077ccf58.tar.gz rneovim-2d9e063a63f8af7eb9e8321c4845ec4f077ccf58.tar.bz2 rneovim-2d9e063a63f8af7eb9e8321c4845ec4f077ccf58.zip |
fix(extmarks): redraw pre-undo position (#27437)
Problem:
Virtual text not redrawn properly after undo moves its extmark.
Solution:
Redraw the moved extmark's pre-undo position.
Diffstat (limited to 'test/functional/ui/decorations_spec.lua')
-rw-r--r-- | test/functional/ui/decorations_spec.lua | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index 9f38c05757..951188614b 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -2230,6 +2230,44 @@ describe('extmark decorations', function() ]]} end) + it('virtual text is drawn correctly after delete and undo #27368', function() + insert('aaa\nbbb\nccc\nddd\neee') + command('vsplit') + api.nvim_buf_set_extmark(0, ns, 2, 0, { virt_text = {{'EOL'}} }) + feed('3gg') + screen:expect{grid=[[ + aaa │aaa | + bbb │bbb | + ^ccc EOL │ccc EOL | + ddd │ddd | + eee │eee | + {1:~ }│{1:~ }|*8 + {41:[No Name] [+] }{40:[No Name] [+] }| + | + ]]} + feed('dd') + screen:expect{grid=[[ + aaa │aaa | + bbb │bbb | + ^ddd EOL │ddd EOL | + eee │eee | + {1:~ }│{1:~ }|*9 + {41:[No Name] [+] }{40:[No Name] [+] }| + | + ]]} + command('silent undo') + screen:expect{grid=[[ + aaa │aaa | + bbb │bbb | + ^ccc EOL │ccc EOL | + ddd │ddd | + eee │eee | + {1:~ }│{1:~ }|*8 + {41:[No Name] [+] }{40:[No Name] [+] }| + | + ]]} + end) + it('works with both hl_group and sign_hl_group', function() screen:try_resize(screen._width, 3) insert('abcdefghijklmn') |