diff options
author | James McCoy <jamessan@jamessan.com> | 2021-12-05 21:57:22 -0500 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2021-12-08 21:47:58 -0500 |
commit | 4453d4c9f1e2cb93bf42e24a622ff00134d7229f (patch) | |
tree | dfc7ecfebc19d89f70241983053af8a6bd7ec642 /src/nvim/testdir | |
parent | d0b3efb7db90ea8fe2637c9538c8b63acc5fbd19 (diff) | |
download | rneovim-4453d4c9f1e2cb93bf42e24a622ff00134d7229f.tar.gz rneovim-4453d4c9f1e2cb93bf42e24a622ff00134d7229f.tar.bz2 rneovim-4453d4c9f1e2cb93bf42e24a622ff00134d7229f.zip |
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
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/test_signs.vim | 31 |
1 files changed, 28 insertions, 3 deletions
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 |