aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-03-14 06:44:41 +0800
committerzeertzjq <zeertzjq@outlook.com>2024-03-14 06:55:10 +0800
commit2af1dc0116c1914684fa0c3d94032c2698a5230d (patch)
treeaaece3caca346dc2a3aef7d15fafd6b289d1fe1d /test/functional
parent9599e5d28d31cfb0cb16e878f123b74283cca26b (diff)
downloadrneovim-2af1dc0116c1914684fa0c3d94032c2698a5230d.tar.gz
rneovim-2af1dc0116c1914684fa0c3d94032c2698a5230d.tar.bz2
rneovim-2af1dc0116c1914684fa0c3d94032c2698a5230d.zip
vim-patch:9.1.0176: Cursor column wrong with 'virtualedit' and conceal
Problem: Cursor column wrong with 'virtualedit' and conceal. Solution: Correct cursor column at end of line if never reached. (zeertzjq) closes: vim/vim#14190 https://github.com/vim/vim/commit/253ff4dece4e6cc4a9ff3ed935bc78f832b6fb7c
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/legacy/conceal_spec.lua88
1 files changed, 88 insertions, 0 deletions
diff --git a/test/functional/legacy/conceal_spec.lua b/test/functional/legacy/conceal_spec.lua
index a7badf6910..63ec644a10 100644
--- a/test/functional/legacy/conceal_spec.lua
+++ b/test/functional/legacy/conceal_spec.lua
@@ -632,4 +632,92 @@ describe('Conceal', function()
feed('$')
expect_pos(9, 26)
end)
+
+ -- oldtest: Test_conceal_virtualedit_after_eol()
+ it('cursor drawn at correct column with virtualedit', function()
+ local screen = Screen.new(75, 3)
+ screen:set_default_attr_ids({
+ [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
+ })
+ screen:attach()
+ exec([[
+ call setline(1, 'abcdefgh|hidden|ijklmnpop')
+ syntax match test /|hidden|/ conceal
+ set conceallevel=2 concealcursor=n virtualedit=all
+ normal! $
+ ]])
+ screen:expect([[
+ abcdefghijklmnpo^p |
+ {0:~ }|
+ |
+ ]])
+ feed('l')
+ screen:expect([[
+ abcdefghijklmnpop^ |
+ {0:~ }|
+ |
+ ]])
+ feed('l')
+ screen:expect([[
+ abcdefghijklmnpop ^ |
+ {0:~ }|
+ |
+ ]])
+ feed('l')
+ screen:expect([[
+ abcdefghijklmnpop ^ |
+ {0:~ }|
+ |
+ ]])
+ feed('rr')
+ screen:expect([[
+ abcdefghijklmnpop ^r |
+ {0:~ }|
+ |
+ ]])
+ end)
+
+ -- oldtest: Test_conceal_virtualedit_after_eol_rightleft()
+ it('cursor drawn correctly with virtualedit and rightleft', function()
+ local screen = Screen.new(75, 3)
+ screen:set_default_attr_ids({
+ [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
+ })
+ screen:attach()
+ exec([[
+ call setline(1, 'abcdefgh|hidden|ijklmnpop')
+ syntax match test /|hidden|/ conceal
+ set conceallevel=2 concealcursor=n virtualedit=all rightleft
+ normal! $
+ ]])
+ screen:expect([[
+ ^popnmlkjihgfedcba|
+ {0: ~}|
+ |
+ ]])
+ feed('h')
+ screen:expect([[
+ ^ popnmlkjihgfedcba|
+ {0: ~}|
+ |
+ ]])
+ feed('h')
+ screen:expect([[
+ ^ popnmlkjihgfedcba|
+ {0: ~}|
+ |
+ ]])
+ feed('h')
+ screen:expect([[
+ ^ popnmlkjihgfedcba|
+ {0: ~}|
+ |
+ ]])
+ feed('rr')
+ screen:expect([[
+ ^r popnmlkjihgfedcba|
+ {0: ~}|
+ |
+ ]])
+ end)
end)