]> granicus.if.org Git - vim/commitdiff
patch 8.2.2644: prop_clear() causes a screen update even when nothing changed v8.2.2644
authorBram Moolenaar <Bram@vim.org>
Mon, 22 Mar 2021 18:43:34 +0000 (19:43 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 22 Mar 2021 18:43:34 +0000 (19:43 +0100)
Problem:    prop_clear() causes a screen update even when nothing changed.
Solution:   Only redraw when a property was cleared. (Dominique PellĂ©)

src/textprop.c
src/version.c

index d6782342dd1199c2a74a410040a62c23221f4916..59b3d53b689268950688e61f58e856faf2516d1f 100644 (file)
@@ -535,6 +535,7 @@ f_prop_clear(typval_T *argvars, typval_T *rettv UNUSED)
     linenr_T end = start;
     linenr_T lnum;
     buf_T    *buf = curbuf;
+    int            did_clear = FALSE;
 
     if (argvars[1].v_type != VAR_UNKNOWN)
     {
@@ -562,6 +563,7 @@ f_prop_clear(typval_T *argvars, typval_T *rettv UNUSED)
        len = STRLEN(text) + 1;
        if ((size_t)buf->b_ml.ml_line_len > len)
        {
+           did_clear = TRUE;
            if (!(buf->b_ml.ml_flags & ML_LINE_DIRTY))
            {
                char_u *newtext = vim_strsave(text);
@@ -575,7 +577,8 @@ f_prop_clear(typval_T *argvars, typval_T *rettv UNUSED)
            buf->b_ml.ml_line_len = (int)len;
        }
     }
-    redraw_buf_later(buf, NOT_VALID);
+    if (did_clear)
+       redraw_buf_later(buf, NOT_VALID);
 }
 
 /*
index 3d69e9c31a0a9cdcec01128a50fe1223d5f757ce..6fda8fcda0f2b99ec4139b337fd7a3857948159e 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2644,
 /**/
     2643,
 /**/