To: vim_dev@googlegroups.com Subject: Patch 8.2.3839 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3839 Problem: Using \z() with \z1 not tested for syntax highlighting. Solution: Add a test. (Dominique Pellé, closes #9365) Files: src/testdir/test_syntax.vim *** ../vim-8.2.3838/src/testdir/test_syntax.vim 2021-11-21 11:35:59.460938795 +0000 --- src/testdir/test_syntax.vim 2021-12-17 17:29:05.894977000 +0000 *************** *** 662,667 **** --- 662,685 ---- call delete('Xtest.c') endfun + " Test \z(...) along with \z1 + func Test_syn_zsub() + new + syntax on + call setline(1, 'xxx start foo xxx not end foo xxx end foo xxx') + let l:expected = ' ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ' + + for l:re in [0, 1, 2] + " Example taken from :help :syn-ext-match + syntax region Z start="start \z(\I\i*\)" skip="not end \z1" end="end \z1" + eval AssertHighlightGroups(1, 1, l:expected, 1, 'regexp=' .. l:re) + syntax clear Z + endfor + + set re& + bw! + endfunc + " Using \z() in a region with NFA failing should not crash. func Test_syn_wrong_z_one() new --- 956,959 ---- *** ../vim-8.2.3838/src/version.c 2021-12-17 16:21:14.911650274 +0000 --- src/version.c 2021-12-17 17:30:17.718565194 +0000 *************** *** 751,752 **** --- 751,754 ---- { /* Add new patch number below this line */ + /**/ + 3839, /**/ -- "I can't complain, but sometimes I still do." (Joe Walsh) /// Bram Moolenaar -- Bram@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 ///