Patch 8.2.2761 Problem: Using "syn include" does not work properly. Solution: Don't add current_syn_inc_tag to topgrp. (Jaehwang Jerry Jung, closes #8104) Files: src/syntax.c, src/testdir/test_syntax.vim
*** ../vim-8.2.2760/src/syntax.c 2021-01-03 19:51:01.392063235 +0100 --- src/syntax.c 2021-04-14 11:10:00.977539305 +0200 *************** *** 5990,6001 **** break; } if (name[1] == 'A') ! id = SYNID_ALLBUT; else if (name[1] == 'T') ! id = SYNID_TOP; else ! id = SYNID_CONTAINED; ! id += current_syn_inc_tag; } else if (name[1] == '@') { --- 5990,6006 ---- break; } if (name[1] == 'A') ! id = SYNID_ALLBUT + current_syn_inc_tag; else if (name[1] == 'T') ! { ! 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 + current_syn_inc_tag; ! } else if (name[1] == '@') { *** ../vim-8.2.2760/src/testdir/test_syntax.vim 2020-11-29 14:11:33.163022803 +0100 --- src/testdir/test_syntax.vim 2021-04-14 11:12:22.605192611 +0200 *************** *** 920,923 **** --- 920,940 ---- 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 *** ../vim-8.2.2760/src/version.c 2021-04-13 21:47:59.544306690 +0200 --- src/version.c 2021-04-14 11:14:02.452943508 +0200 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2761, /**/ -- >From "know your smileys": |-( Contact lenses, but has lost them /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/202104140915.13E9FdFX1191577%40masaka.moolenaar.net.