mirror of
https://github.com/vim/vim.git
synced 2025-10-08 06:04:08 -04:00
patch 8.2.2761: using "syn include" does not work properly
Problem: Using "syn include" does not work properly. Solution: Don't add current_syn_inc_tag to topgrp. (Jaehwang Jerry Jung, closes #8104)
This commit is contained in:
@@ -920,4 +920,21 @@ 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
|
||||
|
Reference in New Issue
Block a user