Skip to content

Commit

Permalink
patch 8.2.2860: adding a text property causes the whole window to be …
Browse files Browse the repository at this point in the history
…redawn

Problem:    Adding a text property causes the whole window to be redawn.
Solution:   Use changed_lines_buf() to only redraw the affected lines.
  • Loading branch information
brammool committed May 16, 2021
1 parent dcfc311 commit 1764faa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/change.c
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/proto/change.pro
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion src/textprop.c
Expand Up @@ -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);
}

/*
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -750,6 +750,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2860,
/**/
2859,
/**/
Expand Down

0 comments on commit 1764faa

Please sign in to comment.