]> granicus.if.org Git - vim/commitdiff
patch 8.2.2862: removing a text property causes the whole window to be redawn v8.2.2862
authorBram Moolenaar <Bram@vim.org>
Sun, 16 May 2021 22:15:18 +0000 (00:15 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 16 May 2021 22:15:18 +0000 (00:15 +0200)
Problem:    Removing a text property causes the whole window to be redawn.
Solution:   Use changed_lines_buf() to only redraw the affected lines.

src/textprop.c
src/version.c

index f11e1a39414b6743896211e8caf0f5230ef33ec7..9a9dddce72000f3889eebf754298f7cb6fa786ca 100644 (file)
@@ -933,7 +933,15 @@ f_prop_remove(typval_T *argvars, typval_T *rettv)
        }
     }
     if (rettv->vval.v_number > 0)
-       redraw_buf_later(buf, NOT_VALID);
+    {
+       if (start == 1 && end == buf->b_ml.ml_line_count)
+           redraw_buf_later(buf, NOT_VALID);
+       else
+       {
+           changed_lines_buf(buf, start, end + 1, 0);
+           redraw_buf_later(buf, VALID);
+       }
+    }
 }
 
 /*
index fca2cd8c4ff7a991d018bf578b535995a544d45f..b5401e624662076898495756d1f92ec7fd445879 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2862,
 /**/
     2861,
 /**/