mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 16:08:36 +00:00
fix(extmarks): restore old position before revalidating
This commit is contained in:
@@ -389,6 +389,9 @@ void extmark_apply_undo(ExtmarkUndoObject undo_info, bool undo)
|
||||
} else if (undo_info.type == kExtmarkSavePos) {
|
||||
ExtmarkSavePos pos = undo_info.data.savepos;
|
||||
if (undo) {
|
||||
if (pos.old_row >= 0) {
|
||||
extmark_setraw(curbuf, pos.mark, pos.old_row, pos.old_col);
|
||||
}
|
||||
if (pos.invalidated) {
|
||||
MarkTreeIter itr[1] = { 0 };
|
||||
MTKey mark = marktree_lookup(curbuf->b_marktree, pos.mark, itr);
|
||||
@@ -396,9 +399,6 @@ void extmark_apply_undo(ExtmarkUndoObject undo_info, bool undo)
|
||||
MTPos end = marktree_get_altpos(curbuf->b_marktree, mark, itr);
|
||||
buf_put_decor(curbuf, mt_decor(mark), mark.pos.row, end.row < 0 ? mark.pos.row : end.row);
|
||||
}
|
||||
if (pos.old_row >= 0) {
|
||||
extmark_setraw(curbuf, pos.mark, pos.old_row, pos.old_col);
|
||||
}
|
||||
// Redo
|
||||
} else {
|
||||
if (pos.row >= 0) {
|
||||
|
Reference in New Issue
Block a user