aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-03-14 07:10:51 +0800
committerGitHub <noreply@github.com>2024-03-14 07:10:51 +0800
commitb501a2354f5f3f348a7a72bc38bc6f7cfe627b1a (patch)
treeaaece3caca346dc2a3aef7d15fafd6b289d1fe1d /test/functional
parentb17be231a61f69b52eb809b6c72b20d3b089495d (diff)
parent2af1dc0116c1914684fa0c3d94032c2698a5230d (diff)
downloadrneovim-b501a2354f5f3f348a7a72bc38bc6f7cfe627b1a.tar.gz
rneovim-b501a2354f5f3f348a7a72bc38bc6f7cfe627b1a.tar.bz2
rneovim-b501a2354f5f3f348a7a72bc38bc6f7cfe627b1a.zip
Merge pull request #27847 from zeertzjq/vim-9.1.0174
vim-patch:9.1.{0174,0176}: conceal fixes
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/legacy/conceal_spec.lua150
1 files changed, 150 insertions, 0 deletions
diff --git a/test/functional/legacy/conceal_spec.lua b/test/functional/legacy/conceal_spec.lua
index 9a23d16c5b..63ec644a10 100644
--- a/test/functional/legacy/conceal_spec.lua
+++ b/test/functional/legacy/conceal_spec.lua
@@ -433,6 +433,68 @@ describe('Conceal', function()
]])
end)
+ -- oldtest: Test_conceal_wrapped_cursorline_wincolor()
+ it('CursorLine highlight on wrapped lines', function()
+ local screen = Screen.new(40, 4)
+ screen:set_default_attr_ids({
+ [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
+ [1] = { background = Screen.colors.Green }, -- CursorLine (low-priority)
+ [2] = { foreground = Screen.colors.Red }, -- CursorLine (high-priority)
+ })
+ screen:attach()
+ exec([[
+ call setline(1, 'one one one |hidden| one one one one one one one one')
+ syntax match test /|hidden|/ conceal
+ set conceallevel=2 concealcursor=n cursorline
+ normal! g$
+ hi! CursorLine guibg=Green
+ ]])
+ screen:expect([[
+ {1:one one one one one one one on^e }|
+ {1: one one one }|
+ {0:~ }|
+ |
+ ]])
+ command('hi! CursorLine guibg=NONE guifg=Red')
+ screen:expect([[
+ {2:one one one one one one one on^e }|
+ {2: one one one }|
+ {0:~ }|
+ |
+ ]])
+ end)
+
+ -- oldtest: Test_conceal_wrapped_cursorline_wincolor_rightleft()
+ it('CursorLine highlight on wrapped lines with rightleft', function()
+ local screen = Screen.new(40, 4)
+ screen:set_default_attr_ids({
+ [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
+ [1] = { background = Screen.colors.Green }, -- CursorLine (low-priority)
+ [2] = { foreground = Screen.colors.Red }, -- CursorLine (high-priority)
+ })
+ screen:attach()
+ exec([[
+ call setline(1, 'one one one |hidden| one one one one one one one one')
+ syntax match test /|hidden|/ conceal
+ set conceallevel=2 concealcursor=n cursorline rightleft
+ normal! g$
+ hi! CursorLine guibg=Green
+ ]])
+ screen:expect([[
+ {1: ^eno eno eno eno eno eno eno eno}|
+ {1: eno eno eno }|
+ {0: ~}|
+ |
+ ]])
+ command('hi! CursorLine guibg=NONE guifg=Red')
+ screen:expect([[
+ {2: ^eno eno eno eno eno eno eno eno}|
+ {2: eno eno eno }|
+ {0: ~}|
+ |
+ ]])
+ end)
+
-- oldtest: Test_conceal_resize_term()
it('resize editor', function()
local screen = Screen.new(75, 6)
@@ -570,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)