aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-12-05 16:13:39 +0100
committerGitHub <noreply@github.com>2023-12-05 16:13:39 +0100
commitca4fe083e5b1a7c2e93cf77aa849fbec72757627 (patch)
tree161c0a3259265f9f1200d3af301ba5d088a001a3 /src
parent14572727261278e5bf68080c9369a8507f3d564f (diff)
parent1cc358aed6fde4f537d971ad9ee207f3d4afc97a (diff)
downloadrneovim-ca4fe083e5b1a7c2e93cf77aa849fbec72757627.tar.gz
rneovim-ca4fe083e5b1a7c2e93cf77aa849fbec72757627.tar.bz2
rneovim-ca4fe083e5b1a7c2e93cf77aa849fbec72757627.zip
Merge pull request #26361 from luukvbaal/invalid
fix(extmarks): restore old position before revalidating
Diffstat (limited to 'src')
-rw-r--r--src/nvim/extmark.c6
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) {