Skip to content

Commit da1dbed

Browse files
committed
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é)
1 parent 1f448d9 commit da1dbed

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/textprop.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ f_prop_clear(typval_T *argvars, typval_T *rettv UNUSED)
535535
linenr_T end = start;
536536
linenr_T lnum;
537537
buf_T *buf = curbuf;
538+
int did_clear = FALSE;
538539

539540
if (argvars[1].v_type != VAR_UNKNOWN)
540541
{
@@ -562,6 +563,7 @@ f_prop_clear(typval_T *argvars, typval_T *rettv UNUSED)
562563
len = STRLEN(text) + 1;
563564
if ((size_t)buf->b_ml.ml_line_len > len)
564565
{
566+
did_clear = TRUE;
565567
if (!(buf->b_ml.ml_flags & ML_LINE_DIRTY))
566568
{
567569
char_u *newtext = vim_strsave(text);
@@ -575,7 +577,8 @@ f_prop_clear(typval_T *argvars, typval_T *rettv UNUSED)
575577
buf->b_ml.ml_line_len = (int)len;
576578
}
577579
}
578-
redraw_buf_later(buf, NOT_VALID);
580+
if (did_clear)
581+
redraw_buf_later(buf, NOT_VALID);
579582
}
580583

581584
/*

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2644,
753755
/**/
754756
2643,
755757
/**/

0 commit comments

Comments
 (0)