summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-05-16 20:18:57 +0200
committerBram Moolenaar <Bram@vim.org>2021-05-16 20:18:57 +0200
commit1764faa38645a559172e9a31f08447385835de81 (patch)
treea99cd5381e3277ed7563664f9461be31aecb1048 /src
parentdcfc311198b174468c007ec4b5b22b33c2c11c92 (diff)
patch 8.2.2860: adding a text property causes the whole window to be redawnv8.2.2860
Problem: Adding a text property causes the whole window to be redawn. Solution: Use changed_lines_buf() to only redraw the affected lines.
Diffstat (limited to 'src')
-rw-r--r--src/change.c2
-rw-r--r--src/proto/change.pro1
-rw-r--r--src/textprop.c3
-rw-r--r--src/version.c2
4 files changed, 6 insertions, 2 deletions
diff --git a/src/change.c b/src/change.c
index 50dc105436..248e6d8487 100644
--- a/src/change.c
+++ b/src/change.c
@@ -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
diff --git a/src/proto/change.pro b/src/proto/change.pro
index 69ba2a6b08..b1aa9d57ec 100644
--- a/src/proto/change.pro
+++ b/src/proto/change.pro
@@ -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);
diff --git a/src/textprop.c b/src/textprop.c
index b62619368f..f11e1a3941 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -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);
}
/*
diff --git a/src/version.c b/src/version.c
index 6a37ad5fff..cd42c0a7ea 100644
--- 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 */
/**/
+ 2860,
+/**/
2859,
/**/
2858,