diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-10-08 06:24:36 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-08 06:24:36 +0800 |
commit | 376de1483ee5380aaf5d2b6bb93d6ba245bfc329 (patch) | |
tree | 7dcc9784f8ada315402e51559a04163f3697d1da /test | |
parent | 88085c2e80a7e3ac29aabb6b5420377eed99b8b6 (diff) | |
download | rneovim-376de1483ee5380aaf5d2b6bb93d6ba245bfc329.tar.gz rneovim-376de1483ee5380aaf5d2b6bb93d6ba245bfc329.tar.bz2 rneovim-376de1483ee5380aaf5d2b6bb93d6ba245bfc329.zip |
fix(drawline): correct highlight priority with Visual selection (#30706)
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/ui/decorations_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/ui/fold_spec.lua | 16 | ||||
-rw-r--r-- | test/functional/ui/spell_spec.lua | 31 |
3 files changed, 42 insertions, 7 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index 042975f898..d96f614cd9 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -1964,7 +1964,7 @@ describe('extmark decorations', function() ]]} end) - pending('highlight applies to a full TAB in visual block mode', function() + it('highlight applies to a full TAB in visual block mode', function() screen:try_resize(50, 8) command('hi! Visual guifg=NONE guibg=LightGrey') api.nvim_buf_set_lines(0, 0, -1, true, {'asdf', '\tasdf', '\tasdf', '\tasdf', 'asdf'}) diff --git a/test/functional/ui/fold_spec.lua b/test/functional/ui/fold_spec.lua index 2712e5ff48..8f6e8aef7e 100644 --- a/test/functional/ui/fold_spec.lua +++ b/test/functional/ui/fold_spec.lua @@ -55,6 +55,8 @@ describe('folded lines', function() }, [19] = { background = Screen.colors.Yellow, foreground = Screen.colors.DarkBlue }, [20] = { background = Screen.colors.Red, bold = true, foreground = Screen.colors.Blue }, + [21] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Green }, + [22] = { background = Screen.colors.Red, foreground = Screen.colors.Green }, }) end) @@ -2625,6 +2627,8 @@ describe('folded lines', function() command('hi! CursorLine guibg=NONE guifg=Red gui=NONE') command('hi F0 guibg=Red guifg=Black') command('hi F1 guifg=White') + command([[syn match Keyword /\<sentence\>/]]) + command('hi! Keyword guibg=NONE guifg=Green') api.nvim_set_option_value('cursorline', true, {}) api.nvim_set_option_value('foldcolumn', '4', {}) api.nvim_set_option_value('foldtext', '', {}) @@ -2662,7 +2666,7 @@ describe('folded lines', function() ## grid 2 {7: }This is a | {7:- }valid English | - {7:│+ }{5:sentence composed by······}| + {7:│+ }{21:sentence}{5: composed by······}| {7:│+ }{13:^in his cave.··············}| {1:~ }|*2 ## grid 3 @@ -2672,7 +2676,7 @@ describe('folded lines', function() screen:expect([[ {7: }This is a | {7:- }valid English | - {7:│+ }{5:sentence composed by······}| + {7:│+ }{21:sentence}{5: composed by······}| {7:│+ }{13:^in his cave.··············}| {1:~ }|*2 | @@ -2689,7 +2693,7 @@ describe('folded lines', function() ## grid 2 {7: }This is a | {7:- }^v{14:alid English} | - {7:│+ }{15:sentence composed by······}| + {7:│+ }{22:sentence}{15: composed by······}| {7:│+ }{15:in his cave.··············}| {1:~ }|*2 ## grid 3 @@ -2699,7 +2703,7 @@ describe('folded lines', function() screen:expect([[ {7: }This is a | {7:- }^v{14:alid English} | - {7:│+ }{15:sentence composed by······}| + {7:│+ }{22:sentence}{15: composed by······}| {7:│+ }{15:in his cave.··············}| {1:~ }|*2 {11:-- VISUAL LINE --} | @@ -2715,7 +2719,7 @@ describe('folded lines', function() ## grid 2 a si sihT{7: }| {14:hsilgnE dila}^v{7: -}| - {15:······yb desopmoc ecnetnes}{7: +│}| + {15:······yb desopmoc }{22:ecnetnes}{7: +│}| {15:··············.evac sih ni}{7: +│}| {1: ~}|*2 ## grid 3 @@ -2725,7 +2729,7 @@ describe('folded lines', function() screen:expect([[ a si sihT{7: }| {14:hsilgnE dila}^v{7: -}| - {15:······yb desopmoc ecnetnes}{7: +│}| + {15:······yb desopmoc }{22:ecnetnes}{7: +│}| {15:··············.evac sih ni}{7: +│}| {1: ~}|*2 {11:-- VISUAL LINE --} | diff --git a/test/functional/ui/spell_spec.lua b/test/functional/ui/spell_spec.lua index da112148cd..f0fa47ebfb 100644 --- a/test/functional/ui/spell_spec.lua +++ b/test/functional/ui/spell_spec.lua @@ -377,4 +377,35 @@ describe("'spell'", function() | ]]) end) + + it('overrides syntax when Visual selection is active', function() + screen:try_resize(43, 3) + screen:set_default_attr_ids({ + [0] = { bold = true, foreground = Screen.colors.Blue }, + [1] = { foreground = Screen.colors.Blue }, + [2] = { foreground = Screen.colors.Red }, + [3] = { foreground = Screen.colors.Blue, underline = true }, + [4] = { foreground = Screen.colors.Red, underline = true }, + [5] = { bold = true }, + }) + exec([[ + hi! Comment guibg=NONE guifg=Blue gui=NONE guisp=NONE + hi! SpellBad guibg=NONE guifg=Red gui=NONE guisp=NONE + hi! Visual guibg=NONE guifg=NONE gui=underline guisp=NONE + syn match Comment "//.*" + call setline(1, '// Here is a misspeld word.') + set spell + ]]) + screen:expect([[ + {1:^// Here is a }{2:misspeld}{1: word.} | + {0:~ }| + | + ]]) + feed('V') + screen:expect([[ + {1:^/}{3:/ Here is a }{4:misspeld}{3: word.} | + {0:~ }| + {5:-- VISUAL LINE --} | + ]]) + end) end) |