diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2023-12-02 11:59:54 +0100 |
---|---|---|
committer | Luuk van Baal <luukvbaal@gmail.com> | 2023-12-02 12:35:52 +0100 |
commit | 1cc358aed6fde4f537d971ad9ee207f3d4afc97a (patch) | |
tree | ff4ef46bafa40bb75a4f2b960122171b265b4372 /src | |
parent | c45d1e32a92f5027fe12038b856509efe5c158fb (diff) | |
download | rneovim-1cc358aed6fde4f537d971ad9ee207f3d4afc97a.tar.gz rneovim-1cc358aed6fde4f537d971ad9ee207f3d4afc97a.tar.bz2 rneovim-1cc358aed6fde4f537d971ad9ee207f3d4afc97a.zip |
fix(extmarks): restore old position before revalidating
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/extmark.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/extmark.c b/src/nvim/extmark.c index f510845ec7..0b8aea35c0 100644 --- a/src/nvim/extmark.c +++ b/src/nvim/extmark.c @@ -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) { |