mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 09:26:30 +00:00
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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user