From 61be343ec8c5e4d504db7ba975b20af2f46ce50d Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Thu, 18 Aug 2022 14:23:04 +0100 Subject: feat(highlight)!: error on invalid names and allow '.' and '@' Previously if a highlight group with a name outside the regexp [a-zA-Z0-9_] was defined, Nvim would emit an "invalid character" warning message. This was annoying for Lua scripts, as it was very hard to debug what line of code was triggering this message since it didn't produce a stack trace. This has now been promoted to an error with the code E5248. Additionally the ASCII character period ('.') and at-sign ('@') have been added to the allowed list of characters of a highlight group name to support the application of defining hierarchical highlight groups, e.g. 'TS.keyword'. Co-authored-by: Christian Clason --- src/nvim/testdir/test_syntax.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/testdir/test_syntax.vim') diff --git a/src/nvim/testdir/test_syntax.vim b/src/nvim/testdir/test_syntax.vim index 7ba0149971..af93a37739 100644 --- a/src/nvim/testdir/test_syntax.vim +++ b/src/nvim/testdir/test_syntax.vim @@ -389,7 +389,7 @@ func Test_invalid_name() syn keyword Nop yes call assert_fails("syntax keyword Wr\x17ong bar", 'E669:') syntax keyword @Wrong bar - call assert_match('W18:', execute('1messages')) + call assert_fails("syntax keyword @#Wrong bar", 'E5248:') syn clear hi clear Nop hi clear @Wrong -- cgit From 914ba18a4969c7170bbaef6856b056e4212a1aa7 Mon Sep 17 00:00:00 2001 From: bfredl Date: Wed, 24 Aug 2022 22:16:37 +0200 Subject: feat(highlight): support scoped @spam.eggs.baked_beans groups --- src/nvim/testdir/test_syntax.vim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/nvim/testdir/test_syntax.vim') diff --git a/src/nvim/testdir/test_syntax.vim b/src/nvim/testdir/test_syntax.vim index af93a37739..85f27dd043 100644 --- a/src/nvim/testdir/test_syntax.vim +++ b/src/nvim/testdir/test_syntax.vim @@ -188,22 +188,22 @@ func Test_syntax_completion() call assert_equal('"syn sync ccomment clear fromstart linebreaks= linecont lines= match maxlines= minlines= region', @:) " Check that clearing "Aap" avoids it showing up before Boolean. - hi Aap ctermfg=blue + hi @Aap ctermfg=blue call feedkeys(":syn list \\\"\", 'tx') - call assert_match('^"syn list Aap Boolean Character ', @:) - hi clear Aap + call assert_match('^"syn list @Aap @boolean @character ', @:) + hi clear @Aap call feedkeys(":syn list \\\"\", 'tx') - call assert_match('^"syn list Boolean Character ', @:) + call assert_match('^"syn list @boolean @character ', @:) call feedkeys(":syn match \\\"\", 'tx') - call assert_match('^"syn match Boolean Character ', @:) + call assert_match('^"syn match @boolean @character ', @:) endfunc func Test_echohl_completion() call feedkeys(":echohl no\\\"\", 'tx') " call assert_equal('"echohl NonText Normal none', @:) - call assert_equal('"echohl NonText Normal NormalFloat NormalNC none', @:) + call assert_equal('"echohl NonText Normal NormalFloat none', @:) endfunc func Test_syntax_arg_skipped() -- cgit From 2676555b229feae462df32bf6dfce7f234b7be53 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 27 Aug 2022 06:44:13 +0800 Subject: vim-patch:9.0.0283: cannot complete "syn list @cluster" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: Cannot complete "syn list @cluster". Solution: Recognize and handle "list @". (Björn Linse, closes vim/vim#10990) https://github.com/vim/vim/commit/af9a6002e0761012cb7108cbfa179a880d3cb49b --- src/nvim/testdir/test_syntax.vim | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/nvim/testdir/test_syntax.vim') diff --git a/src/nvim/testdir/test_syntax.vim b/src/nvim/testdir/test_syntax.vim index 85f27dd043..ccff01486e 100644 --- a/src/nvim/testdir/test_syntax.vim +++ b/src/nvim/testdir/test_syntax.vim @@ -198,6 +198,10 @@ func Test_syntax_completion() call feedkeys(":syn match \\\"\", 'tx') call assert_match('^"syn match @boolean @character ', @:) + + syn cluster Aax contains=Aap + call feedkeys(":syn list @A\\\"\", 'tx') + call assert_match('^"syn list @Aax', @:) endfunc func Test_echohl_completion() -- cgit