-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix interpretation of TOP
in syn include
d file
#8104
Conversation
When running `syn include @name FILE`, the `TOP` in the sourced `FILE` should be interpreted as `@NAME`, not the `TOP` of the caller. For example, consider markdown fenced code block containing C code. To highlight the C code in the block, we would write something like this in syntax/markdown.vim: syn include @FENCED_C syntax/c.vim syn region start="```c" end="```" contains=@FENCED_C In this case, this line in $VIMRUNTIME/syntax/c.vim syn region cCppOutElse ... contains=TOP,... should be should be interpreted as syn region cCppOutElse ... contains=@FENCED_C,... because we want `cCppOutElse` to contain the `TOP` of C syntax, not the `TOP` of markdown syntax.
Codecov Report
@@ Coverage Diff @@
## master #8104 +/- ##
==========================================
- Coverage 89.34% 88.90% -0.44%
==========================================
Files 148 144 -4
Lines 166205 164947 -1258
==========================================
- Hits 148488 146647 -1841
- Misses 17717 18300 +583
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
You have examples, so perhaps you can turn them into a test? |
c40649f
to
7d9b812
Compare
7d9b812
to
efbe78e
Compare
Problem: Using "syn include" does not work properly. Solution: Don't add current_syn_inc_tag to topgrp. (Jaehwang Jerry Jung, closes vim/vim#8104) vim/vim@2e240bd Cherry-pick AssertHighlightGroups from patch v8.2.2068.
Problem: Using "syn include" does not work properly. Solution: Don't add current_syn_inc_tag to topgrp. (Jaehwang Jerry Jung, closes vim/vim#8104) vim/vim@2e240bd Cherry-pick AssertHighlightGroups from patch v8.2.2068.
Problem: Using "syn include" does not work properly. Solution: Don't add current_syn_inc_tag to topgrp. (Jaehwang Jerry Jung, closes vim/vim#8104) vim/vim@2e240bd Cherry-pick AssertHighlightGroups from patch v8.2.2068.
Problem: Using "syn include" does not work properly. Solution: Don't add current_syn_inc_tag to topgrp. (Jaehwang Jerry Jung, closes vim/vim#8104) vim/vim@2e240bd Cherry-pick AssertHighlightGroups from patch v8.2.2068.
When running
syn include @NAME FILE
, theTOP
in the sourcedFILE
should be interpreted as
@NAME
, not theTOP
of the caller.For example, consider markdown fenced code block containing C code. To
highlight the C code in the block, we would write something like this in
syntax/markdown.vim:
In this case, this line in $VIMRUNTIME/syntax/c.vim
should be should be interpreted as
because we want
cCppOutElse
to contain theTOP
of C syntax, not theTOP
of markdown syntax.