Skip to content

Commit 2f97912

Browse files
committed
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)
1 parent 6d5ad4c commit 2f97912

3 files changed

Lines changed: 24 additions & 3 deletions

File tree

src/screen.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3981,9 +3981,6 @@ win_line(
39813981
else if (v == (long)shl->endcol)
39823982
{
39833983
shl->attr_cur = 0;
3984-
#ifdef FEAT_CONCEAL
3985-
prev_syntax_id = 0;
3986-
#endif
39873984
next_search_hl(wp, shl, lnum, (colnr_T)v,
39883985
shl == &search_hl ? NULL : cur);
39893986
pos_inprogress = cur == NULL || cur->pos.cur == 0

src/testdir/test_matchadd_conceal.vim

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,3 +264,25 @@ function! Test_matchadd_repeat_conceal_with_syntax_off()
264264

265265
quit!
266266
endfunction
267+
268+
function! Test_matchadd_and_syn_conceal()
269+
new
270+
let cnt='Inductive bool : Type := | true : bool | false : bool.'
271+
let expect = 'Inductive - : Type := | true : - | false : -.'
272+
0put =cnt
273+
" set filetype and :syntax on to change screenattr()
274+
set cole=1 cocu=nv
275+
hi link CheckedByCoq WarningMsg
276+
syntax on
277+
syntax keyword coqKwd bool conceal cchar=-
278+
redraw!
279+
call assert_equal(expect, s:screenline(1))
280+
call assert_notequal(screenattr(1, 10) , screenattr(1, 11))
281+
call assert_notequal(screenattr(1, 11) , screenattr(1, 12))
282+
call assert_equal(screenattr(1, 11) , screenattr(1, 32))
283+
call matchadd('CheckedByCoq', '\%<2l\%>9c\%<16c')
284+
call assert_equal(expect, s:screenline(1))
285+
call assert_notequal(screenattr(1, 10) , screenattr(1, 11))
286+
call assert_notequal(screenattr(1, 11) , screenattr(1, 12))
287+
call assert_equal(screenattr(1, 11) , screenattr(1, 32))
288+
endfunction

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
49,
767769
/**/
768770
48,
769771
/**/

0 commit comments

Comments
 (0)