aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/extmark.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-02-12 13:02:27 +0800
committerGitHub <noreply@github.com>2024-02-12 13:02:27 +0800
commit929e1b7f1c35679424989f5ebfc78f095bb434d9 (patch)
tree9926fa873746da91cb2564c4d2606ff11829817e /src/nvim/extmark.c
parent950a0ac61c70362f168338b815675ac60b1d72dc (diff)
downloadrneovim-929e1b7f1c35679424989f5ebfc78f095bb434d9.tar.gz
rneovim-929e1b7f1c35679424989f5ebfc78f095bb434d9.tar.bz2
rneovim-929e1b7f1c35679424989f5ebfc78f095bb434d9.zip
perf(extmarks): avoid unnecessary invalidations for virt_text (#27435)
Invalidation of most w_valid flags isn't needed when adding or removing virtual text below cursor.
Diffstat (limited to 'src/nvim/extmark.c')
-rw-r--r--src/nvim/extmark.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/extmark.c b/src/nvim/extmark.c
index 93a2b9c16a..0f9e7749f1 100644
--- a/src/nvim/extmark.c
+++ b/src/nvim/extmark.c
@@ -75,7 +75,7 @@ void extmark_set(buf_T *buf, uint32_t ns_id, uint32_t *idp, int row, colnr_T col
// not paired: we can revise in place
if (!invalid && mt_decor_any(old_mark)) {
mt_itr_rawkey(itr).flags &= (uint16_t) ~MT_FLAG_DECOR_SIGNTEXT;
- buf_decor_remove(buf, row, row, mt_decor(old_mark), true);
+ buf_decor_remove(buf, row, row, col, mt_decor(old_mark), true);
}
mt_itr_rawkey(itr).flags &= (uint16_t) ~MT_FLAG_EXTERNAL_MASK;
mt_itr_rawkey(itr).flags |= flags;
@@ -84,7 +84,8 @@ void extmark_set(buf_T *buf, uint32_t ns_id, uint32_t *idp, int row, colnr_T col
}
marktree_del_itr(buf->b_marktree, itr, false);
if (!invalid) {
- buf_decor_remove(buf, old_mark.pos.row, old_mark.pos.row, mt_decor(old_mark), true);
+ buf_decor_remove(buf, old_mark.pos.row, old_mark.pos.row, old_mark.pos.col,
+ mt_decor(old_mark), true);
}
}
} else {
@@ -99,7 +100,7 @@ void extmark_set(buf_T *buf, uint32_t ns_id, uint32_t *idp, int row, colnr_T col
revised:
if (decor_flags || decor.ext) {
buf_put_decor(buf, decor, row, end_row > -1 ? end_row : row);
- decor_redraw(buf, row, end_row > -1 ? end_row : row, decor);
+ decor_redraw(buf, row, end_row > -1 ? end_row : row, col, decor);
}
if (idp) {
@@ -170,7 +171,7 @@ void extmark_del(buf_T *buf, MarkTreeIter *itr, MTKey key, bool restore)
if (mt_invalid(key)) {
decor_free(mt_decor(key));
} else {
- buf_decor_remove(buf, key.pos.row, key2.pos.row, mt_decor(key), true);
+ buf_decor_remove(buf, key.pos.row, key2.pos.row, key.pos.col, mt_decor(key), true);
}
}
@@ -369,7 +370,7 @@ void extmark_splice_delete(buf_T *buf, int l_row, colnr_T l_col, int u_row, coln
} else {
invalidated = true;
mt_itr_rawkey(itr).flags |= MT_FLAG_INVALID;
- buf_decor_remove(buf, mark.pos.row, endpos.row, mt_decor(mark), false);
+ buf_decor_remove(buf, mark.pos.row, endpos.row, mark.pos.col, mt_decor(mark), false);
}
}
}