To: vim_dev@googlegroups.com Subject: Patch 8.0.0049 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0049 Problem: When a match ends in part of concealed text highlighting, it might mess up concealing by resetting prev_syntax_id. Solution: Do not reset prev_syntax_id and add a test to verify. (Christian Brabandt, closes #1092) Files: src/screen.c, src/testdir/test_matchadd_conceal.vim *** ../vim-8.0.0048/src/screen.c 2016-10-16 14:35:44.543696445 +0200 --- src/screen.c 2016-10-27 17:26:54.065343448 +0200 *************** *** 3981,3989 **** else if (v == (long)shl->endcol) { shl->attr_cur = 0; - #ifdef FEAT_CONCEAL - prev_syntax_id = 0; - #endif next_search_hl(wp, shl, lnum, (colnr_T)v, shl == &search_hl ? NULL : cur); pos_inprogress = cur == NULL || cur->pos.cur == 0 --- 3981,3986 ---- *** ../vim-8.0.0048/src/testdir/test_matchadd_conceal.vim 2016-04-14 17:59:07.000000000 +0200 --- src/testdir/test_matchadd_conceal.vim 2016-10-27 17:20:24.939714129 +0200 *************** *** 264,266 **** --- 264,288 ---- quit! endfunction + + function! Test_matchadd_and_syn_conceal() + new + let cnt='Inductive bool : Type := | true : bool | false : bool.' + let expect = 'Inductive - : Type := | true : - | false : -.' + 0put =cnt + " set filetype and :syntax on to change screenattr() + set cole=1 cocu=nv + hi link CheckedByCoq WarningMsg + syntax on + syntax keyword coqKwd bool conceal cchar=- + redraw! + call assert_equal(expect, s:screenline(1)) + call assert_notequal(screenattr(1, 10) , screenattr(1, 11)) + call assert_notequal(screenattr(1, 11) , screenattr(1, 12)) + call assert_equal(screenattr(1, 11) , screenattr(1, 32)) + call matchadd('CheckedByCoq', '\%<2l\%>9c\%<16c') + call assert_equal(expect, s:screenline(1)) + call assert_notequal(screenattr(1, 10) , screenattr(1, 11)) + call assert_notequal(screenattr(1, 11) , screenattr(1, 12)) + call assert_equal(screenattr(1, 11) , screenattr(1, 32)) + endfunction *** ../vim-8.0.0048/src/version.c 2016-10-27 16:46:49.423993309 +0200 --- src/version.c 2016-10-27 17:20:49.627563722 +0200 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 49, /**/ -- If you don't get everything you want, think of everything you didn't get and don't want. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///