changeset 24206:55631f8e0730 v8.2.2644

patch 8.2.2644: prop_clear() causes a screen update even when nothing changed Commit: https://github.com/vim/vim/commit/da1dbed0dfac00952b42982f8fffa42c4f5ed0c8 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Mar 22 19:43:34 2021 +0100 patch 8.2.2644: prop_clear() causes a screen update even when nothing changed Problem: prop_clear() causes a screen update even when nothing changed. Solution: Only redraw when a property was cleared. (Dominique Pell?)
author Bram Moolenaar <Bram@vim.org>
date Mon, 22 Mar 2021 19:45:05 +0100
parents f8f6ec7d7652
children 29ae46ae449b
files src/textprop.c src/version.c
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -535,6 +535,7 @@ f_prop_clear(typval_T *argvars, typval_T
     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
 	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
 	    buf->b_ml.ml_line_len = (int)len;
 	}
     }
-    redraw_buf_later(buf, NOT_VALID);
+    if (did_clear)
+	redraw_buf_later(buf, NOT_VALID);
 }
 
 /*
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2644,
+/**/
     2643,
 /**/
     2642,