]> granicus.if.org Git - vim/commitdiff
patch 8.2.2860: adding a text property causes the whole window to be redawn v8.2.2860
authorBram Moolenaar <Bram@vim.org>
Sun, 16 May 2021 18:18:57 +0000 (20:18 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 16 May 2021 18:18:57 +0000 (20:18 +0200)
Problem:    Adding a text property causes the whole window to be redawn.
Solution:   Use changed_lines_buf() to only redraw the affected lines.

src/change.c
src/proto/change.pro
src/textprop.c
src/version.c

index 50dc105436a775068267503b5c5f2c7daf037e5d..248e6d84874b937ed6af5742db4abef026416af9 100644 (file)
@@ -758,7 +758,7 @@ deleted_lines_mark(linenr_T lnum, long count)
 /*
  * Marks the area to be redrawn after a change.
  */
-    static void
+    void
 changed_lines_buf(
     buf_T      *buf,
     linenr_T   lnum,       // first line with change
index 69ba2a6b08fdd74b9d7dd6cb3f57d4b52d746535..b1aa9d57ec81109eae4473f0ac12239cb488c3fa 100644 (file)
@@ -14,6 +14,7 @@ void appended_lines(linenr_T lnum, long count);
 void appended_lines_mark(linenr_T lnum, long count);
 void deleted_lines(linenr_T lnum, long count);
 void deleted_lines_mark(linenr_T lnum, long count);
+void changed_lines_buf(buf_T *buf, linenr_T lnum, linenr_T lnume, long xtra);
 void changed_lines(linenr_T lnum, colnr_T col, linenr_T lnume, long xtra);
 void unchanged(buf_T *buf, int ff, int always_inc_changedtick);
 void save_file_ff(buf_T *buf);
index b62619368f2dae494b9dfee54232f3c0e855c6ee..f11e1a39414b6743896211e8caf0f5230ef33ec7 100644 (file)
@@ -345,7 +345,8 @@ prop_add_common(
     }
 
     buf->b_has_textprop = TRUE;  // this is never reset
-    redraw_buf_later(buf, NOT_VALID);
+    changed_lines_buf(buf, start_lnum, end_lnum + 1, 0);
+    redraw_buf_later(buf, VALID);
 }
 
 /*
index 6a37ad5fff0f4eb420af7a713238123a2f30e17c..cd42c0a7ea8242952bbff0ff89502e5f642e43b8 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2860,
 /**/
     2859,
 /**/