From e8f9262125535bea8c7fcf833a715b569e07996e Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sun, 5 Dec 2021 15:36:54 -0500 Subject: vim-patch:8.2.3664: cannot adjust sign highlighting for 'cursorline' Problem: Cannot adjust sign highlighting for 'cursorline'. Solution: Add CursorLineSign and CursorLineFold highlight groups. (Gregory Anders, closes vim/vim#9201) https://github.com/vim/vim/commit/e413ea04b716effb28eb49dbc98ad3f9f761545a --- src/nvim/testdir/test_signs.vim | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_signs.vim b/src/nvim/testdir/test_signs.vim index f287256396..35c80b375a 100644 --- a/src/nvim/testdir/test_signs.vim +++ b/src/nvim/testdir/test_signs.vim @@ -15,13 +15,13 @@ func Test_sign() " the icon name when listing signs. sign define Sign1 text=x - call Sign_command_ignore_error('sign define Sign2 text=xy texthl=Title linehl=Error icon=../../pixmaps/stock_vim_find_help.png') + call Sign_command_ignore_error('sign define Sign2 text=xy texthl=Title linehl=Error culhl=Search icon=../../pixmaps/stock_vim_find_help.png') " Test listing signs. let a=execute('sign list') call assert_match('^\nsign Sign1 text=x \nsign Sign2 ' . \ 'icon=../../pixmaps/stock_vim_find_help.png .*text=xy ' . - \ 'linehl=Error texthl=Title$', a) + \ 'linehl=Error texthl=Title culhl=Search$', a) let a=execute('sign list Sign1') call assert_equal("\nsign Sign1 text=x ", a) @@ -392,19 +392,21 @@ func Test_sign_funcs() call sign_undefine() " Tests for sign_define() - let attr = {'text' : '=>', 'linehl' : 'Search', 'texthl' : 'Error'} + let attr = {'text' : '=>', 'linehl' : 'Search', 'texthl' : 'Error', + \ 'culhl': 'Visual'} call assert_equal(0, "sign1"->sign_define(attr)) call assert_equal([{'name' : 'sign1', 'texthl' : 'Error', - \ 'linehl' : 'Search', 'text' : '=>'}], sign_getdefined()) + \ 'linehl' : 'Search', 'culhl': 'Visual', 'text' : '=>'}], + \ sign_getdefined()) " Define a new sign without attributes and then update it call sign_define("sign2") let attr = {'text' : '!!', 'linehl' : 'DiffAdd', 'texthl' : 'DiffChange', - \ 'icon' : 'sign2.ico'} + \ 'culhl': 'DiffDelete', 'icon' : 'sign2.ico'} call Sign_define_ignore_error("sign2", attr) call assert_equal([{'name' : 'sign2', 'texthl' : 'DiffChange', - \ 'linehl' : 'DiffAdd', 'text' : '!!', 'icon' : 'sign2.ico'}], - \ "sign2"->sign_getdefined()) + \ 'linehl' : 'DiffAdd', 'culhl' : 'DiffDelete', 'text' : '!!', + \ 'icon' : 'sign2.ico'}], "sign2"->sign_getdefined()) " Test for a sign name with digits call assert_equal(0, sign_define(0002, {'linehl' : 'StatusLine'})) -- cgit From d0b3efb7db90ea8fe2637c9538c8b63acc5fbd19 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sun, 5 Dec 2021 21:39:37 -0500 Subject: vim-patch:8.2.3743: ":sign" can add a highlight group without a name Problem: ":sign" can add a highlight group without a name. Solution: Give an error if the group name is missing. (closes vim/vim#9280) https://github.com/vim/vim/commit/5e18ccc60bdddc4aa39ab039f1a7c918f29e67ce --- src/nvim/testdir/test_signs.vim | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_signs.vim b/src/nvim/testdir/test_signs.vim index 35c80b375a..3afabfa959 100644 --- a/src/nvim/testdir/test_signs.vim +++ b/src/nvim/testdir/test_signs.vim @@ -126,6 +126,10 @@ func Test_sign() " call assert_fails("sign define Sign4 text= linehl=Comment", 'E239:') call assert_fails("sign define Sign4 text=\\ ab linehl=Comment", 'E239:') + call assert_fails("sign define Sign4 linehl=", 'E1249: Group name missing for linehl') + call assert_fails("sign define Sign4 culhl=", 'E1249: Group name missing for culhl') + call assert_fails("sign define Sign4 texthl=", 'E1249: Group name missing for texthl') + " define sign with whitespace sign define Sign4 text=\ X linehl=Comment sign undefine Sign4 -- cgit From 4453d4c9f1e2cb93bf42e24a622ff00134d7229f Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sun, 5 Dec 2021 21:57:22 -0500 Subject: vim-patch:8.2.3747: cannot remove highlight from an existing sign Problem: Cannot remove highlight from an existing sign. (James McCoy) Solution: Only reject empty argument for a new sign. https://github.com/vim/vim/commit/0bac5fc5e125b7aa0f3b596c9b7f4381279e6688 --- src/nvim/testdir/test_signs.vim | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_signs.vim b/src/nvim/testdir/test_signs.vim index 3afabfa959..c570d2c37e 100644 --- a/src/nvim/testdir/test_signs.vim +++ b/src/nvim/testdir/test_signs.vim @@ -126,9 +126,34 @@ func Test_sign() " call assert_fails("sign define Sign4 text= linehl=Comment", 'E239:') call assert_fails("sign define Sign4 text=\\ ab linehl=Comment", 'E239:') - call assert_fails("sign define Sign4 linehl=", 'E1249: Group name missing for linehl') - call assert_fails("sign define Sign4 culhl=", 'E1249: Group name missing for culhl') - call assert_fails("sign define Sign4 texthl=", 'E1249: Group name missing for texthl') + " an empty highlight argument for a new sign is an error + call assert_fails("sign define SignX linehl=", 'E1249: Group name missing for linehl') + call assert_fails("sign define SignX culhl=", 'E1249: Group name missing for culhl') + call assert_fails("sign define SignX texthl=", 'E1249: Group name missing for texthl') + + " an empty highlight argument for an existing sign clears it + sign define SignY texthl=TextHl culhl=CulHl linehl=LineHl + let sl = sign_getdefined('SignY')[0] + call assert_equal('TextHl', sl.texthl) + call assert_equal('CulHl', sl.culhl) + call assert_equal('LineHl', sl.linehl) + + sign define SignY texthl= culhl=CulHl linehl=LineHl + let sl = sign_getdefined('SignY')[0] + call assert_false(has_key(sl, 'texthl')) + call assert_equal('CulHl', sl.culhl) + call assert_equal('LineHl', sl.linehl) + + sign define SignY linehl= + let sl = sign_getdefined('SignY')[0] + call assert_false(has_key(sl, 'linehl')) + call assert_equal('CulHl', sl.culhl) + + sign define SignY culhl= + let sl = sign_getdefined('SignY')[0] + call assert_false(has_key(sl, 'culhl')) + + sign undefine SignY " define sign with whitespace sign define Sign4 text=\ X linehl=Comment -- cgit From 5fda23c307404a9d7d0e4d7b592df503ed1cb110 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sun, 5 Dec 2021 22:11:08 -0500 Subject: vim-patch:8.2.3748: giving an error for an empty sign argument breaks a plugin Problem: Giving an error for an empty sign argument breaks a plugin. Solution: Do not give an error. https://github.com/vim/vim/commit/e5710a02cb78c2a0a868ea55740835c78ddecbb4 --- src/nvim/testdir/test_signs.vim | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_signs.vim b/src/nvim/testdir/test_signs.vim index c570d2c37e..799e6cb57b 100644 --- a/src/nvim/testdir/test_signs.vim +++ b/src/nvim/testdir/test_signs.vim @@ -126,11 +126,6 @@ func Test_sign() " call assert_fails("sign define Sign4 text= linehl=Comment", 'E239:') call assert_fails("sign define Sign4 text=\\ ab linehl=Comment", 'E239:') - " an empty highlight argument for a new sign is an error - call assert_fails("sign define SignX linehl=", 'E1249: Group name missing for linehl') - call assert_fails("sign define SignX culhl=", 'E1249: Group name missing for culhl') - call assert_fails("sign define SignX texthl=", 'E1249: Group name missing for texthl') - " an empty highlight argument for an existing sign clears it sign define SignY texthl=TextHl culhl=CulHl linehl=LineHl let sl = sign_getdefined('SignY')[0] -- cgit From f3fb77c40262f47e30ebefec547f5c6f83ff58e6 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Wed, 8 Dec 2021 21:35:14 -0500 Subject: vim-patch:8.2.3757: an overlong highlight group name is silently truncated Problem: An overlong highlight group name is silently truncated. Solution: Give an error if the name is too long. (closes vim/vim#9289) https://github.com/vim/vim/commit/f7f7aaf8aaad34a38d3f159e031c5bcf3394f8f1 --- src/nvim/testdir/test_highlight.vim | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_highlight.vim b/src/nvim/testdir/test_highlight.vim index c38bfa5677..899eb530ec 100644 --- a/src/nvim/testdir/test_highlight.vim +++ b/src/nvim/testdir/test_highlight.vim @@ -661,6 +661,13 @@ function Test_no_space_before_xxx() let &columns = l:org_columns endfunction +" Test for :highlight command errors +func Test_highlight_cmd_errors() + if has('gui_running') || has('nvim') + call assert_fails('hi ' .. repeat('a', 201) .. ' ctermfg=black', 'E1249:') + endif +endfunc + " Test for using RGB color values in a highlight group func Test_xxlast_highlight_RGB_color() CheckCanRunGui -- cgit