mirror of
https://github.com/neovim/neovim.git
synced 2025-01-01 17:23:36 -07:00
Merge pull request #29027 from neovim/backport-28961-to-release-0.10
fix(extmarks): issues with revalidating marks
This commit is contained in:
commit
565fccbeeb
@ -117,9 +117,16 @@ static void extmark_setraw(buf_T *buf, uint64_t mark, int row, colnr_T col, bool
|
|||||||
MarkTreeIter itr[1] = { 0 };
|
MarkTreeIter itr[1] = { 0 };
|
||||||
MTKey key = marktree_lookup(buf->b_marktree, mark, itr);
|
MTKey key = marktree_lookup(buf->b_marktree, mark, itr);
|
||||||
if (key.pos.row < 0 || (key.pos.row == row && key.pos.col == col)) {
|
if (key.pos.row < 0 || (key.pos.row == row && key.pos.col == col)) {
|
||||||
|
// Does this hold? If it doesn't, we should still revalidate.
|
||||||
|
assert(!invalid || !mt_invalid(key));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Key already revalidated(how?) Avoid adding to decor again.
|
||||||
|
if (invalid && !mt_invalid(key)) {
|
||||||
|
invalid = false;
|
||||||
|
}
|
||||||
|
|
||||||
// Only the position before undo needs to be redrawn here,
|
// Only the position before undo needs to be redrawn here,
|
||||||
// as the position after undo should be marked as changed.
|
// as the position after undo should be marked as changed.
|
||||||
if (!invalid && mt_decor_any(key) && key.pos.row != row) {
|
if (!invalid && mt_decor_any(key) && key.pos.row != row) {
|
||||||
@ -140,8 +147,8 @@ static void extmark_setraw(buf_T *buf, uint64_t mark, int row, colnr_T col, bool
|
|||||||
marktree_move(buf->b_marktree, itr, row, col);
|
marktree_move(buf->b_marktree, itr, row, col);
|
||||||
|
|
||||||
if (invalid) {
|
if (invalid) {
|
||||||
MTPos end = marktree_get_altpos(buf->b_marktree, key, NULL);
|
row2 = mt_paired(key) ? marktree_get_altpos(buf->b_marktree, key, NULL).row : row;
|
||||||
buf_put_decor(buf, mt_decor(key), row, end.row);
|
buf_put_decor(buf, mt_decor(key), row, row2);
|
||||||
} else if (key.flags & MT_FLAG_DECOR_SIGNTEXT && buf->b_signcols.autom) {
|
} else if (key.flags & MT_FLAG_DECOR_SIGNTEXT && buf->b_signcols.autom) {
|
||||||
buf_signcols_count_range(buf, row1, row2, 0, kNone);
|
buf_signcols_count_range(buf, row1, row2, 0, kNone);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user