# HG changeset patch # User Christian Brabandt # Date 1477582204 -7200 # Node ID f4798aebef670245ff09df384fb5a372c87a6ed3 # Parent d75e2380db0efebcd58f636d9da2b384cec50439 commit https://github.com/vim/vim/commit/2f97912800e86a296c001832bbbf2fc425f1e533 Author: Bram Moolenaar Date: Thu Oct 27 17:27:44 2016 +0200 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) diff --git a/src/screen.c b/src/screen.c --- a/src/screen.c +++ b/src/screen.c @@ -3981,9 +3981,6 @@ win_line( 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 diff --git a/src/testdir/test_matchadd_conceal.vim b/src/testdir/test_matchadd_conceal.vim --- a/src/testdir/test_matchadd_conceal.vim +++ b/src/testdir/test_matchadd_conceal.vim @@ -264,3 +264,25 @@ function! Test_matchadd_repeat_conceal_w 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 diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -765,6 +765,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 49, +/**/ 48, /**/ 47,