Skip to content

Commit

Permalink
Merge efbe78e into f6a8d42
Browse files Browse the repository at this point in the history
  • Loading branch information
tomtomjhj authored Apr 14, 2021
2 parents f6a8d42 + efbe78e commit 4ad84b3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/syntax.c
Original file line number Diff line number Diff line change
Expand Up @@ -5990,12 +5990,17 @@ get_id_list(
break;
}
if (name[1] == 'A')
id = SYNID_ALLBUT;
id = SYNID_ALLBUT + current_syn_inc_tag;
else if (name[1] == 'T')
id = SYNID_TOP;
{
if (curwin->w_s->b_syn_topgrp >= SYNID_CLUSTER)
id = curwin->w_s->b_syn_topgrp;
else
id = SYNID_TOP + current_syn_inc_tag;
}
else
id = SYNID_CONTAINED;
id += current_syn_inc_tag;
id = SYNID_CONTAINED + current_syn_inc_tag;

}
else if (name[1] == '@')
{
Expand Down
15 changes: 15 additions & 0 deletions src/testdir/test_syntax.vim
Original file line number Diff line number Diff line change
Expand Up @@ -920,4 +920,19 @@ func Test_syn_contained_transparent()
bw!
endfunc

func Test_syn_include_contains_TOP()
let l:case = "TOP in included syntax means its group list name"
new
syntax include @INCLUDED syntax/c.vim
syntax region FencedCodeBlockC start=/```c/ end=/```/ contains=@INCLUDED

call setline(1, ['```c', '#if 0', 'int', '#else', 'int', '#endif', '```' ])
let l:expected = ["cCppOutIf2"]
eval AssertHighlightGroups(3, 1, l:expected, 1)
" cCppOutElse has contains=TOP
let l:expected = ["cType"]
eval AssertHighlightGroups(5, 1, l:expected, 1, l:case)
syntax clear
bw!
endfunc
" vim: shiftwidth=2 sts=2 expandtab

0 comments on commit 4ad84b3

Please sign in to comment.