aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/change.c
diff options
context:
space:
mode:
authorIbby <33922797+SleepySwords@users.noreply.github.com>2023-08-26 21:39:05 +1000
committerGitHub <noreply@github.com>2023-08-26 19:39:05 +0800
commit362df0f7938a0e6147ecf886655a0689430d426d (patch)
treed92481ed05770f42eb707a1626f161990c567b80 /src/nvim/change.c
parent1bdcb9aaf11e914d4c7af14e8e5be4ed3c5798ae (diff)
downloadrneovim-362df0f7938a0e6147ecf886655a0689430d426d.tar.gz
rneovim-362df0f7938a0e6147ecf886655a0689430d426d.tar.bz2
rneovim-362df0f7938a0e6147ecf886655a0689430d426d.zip
fix(extmarks): wrong display when changing text with virt_lines (#24879)
Diffstat (limited to 'src/nvim/change.c')
-rw-r--r--src/nvim/change.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nvim/change.c b/src/nvim/change.c
index 067b48faee..084a8a1897 100644
--- a/src/nvim/change.c
+++ b/src/nvim/change.c
@@ -319,7 +319,12 @@ static void changed_common(buf_T *buf, linenr_T lnum, colnr_T col, linenr_T lnum
if (wp->w_lines[i].wl_lnum >= lnum) {
// Do not change wl_lnum at index zero, it is used to
// compare with w_topline. Invalidate it instead.
- if (wp->w_lines[i].wl_lnum < lnume || i == 0) {
+ // If the buffer has virt_lines, invalidate the line
+ // after the changed lines as the virt_lines for a
+ // changed line may become invalid.
+ if (i == 0 || wp->w_lines[i].wl_lnum < lnume
+ || (wp->w_lines[i].wl_lnum == lnume
+ && wp->w_buffer->b_virt_line_blocks > 0)) {
// line included in change
wp->w_lines[i].wl_valid = false;
} else if (xtra != 0) {