]> granicus.if.org Git - vim/commitdiff
patch 8.0.0049 v8.0.0049
authorBram Moolenaar <Bram@vim.org>
Thu, 27 Oct 2016 15:27:44 +0000 (17:27 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 27 Oct 2016 15:27:44 +0000 (17:27 +0200)
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)

src/screen.c
src/testdir/test_matchadd_conceal.vim
src/version.c

index 78f89ebf6a6ff2fdb2bf87d725b63c17ae395ae1..c98d5670b30ad34d2b4aea47a8584eda01cebb05 100644 (file)
@@ -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
index 5da28160c1bbeb4698705bb8e4c3fe7099afa691..610917fd11d4a06f42f061a7ede549ebdb60cf30 100644 (file)
@@ -264,3 +264,25 @@ function! Test_matchadd_repeat_conceal_with_syntax_off()
 
   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
index 81de3d0471d3c73abbccac339ec8dd6edc3cf0f8..6fdf9f42ecc1a5faf0a4bb034d1e686587326526 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    49,
 /**/
     48,
 /**/