Vim undo sometimes reverts back multiple steps

Steps to reproduce

Insert mode type
123
then in normal mode type
o 456
now you have
123
456
Go up one line to 123. Delete with dd, paste with p.
Now you have
456
123
Now undo once with u
123
This is weird. The last action I did is to paste 123, so it should undo the paste and only 456 should be there.
Undo again
everything is gone.

Expected result

123
456
should actually appear again, instead both lines are gone.

This means that some steps are not recorded so when pressing u once you never know if you undo once or multiple times.

Potential cause

I think that the action o isn’t recorded as well as dd and p, because every step after 123 seems to be forgotten by undo.
I press o 456 , then dd and p.
So does obsidian only record stuff from Insert mode?


Additional information

This is very scary because you might lose text you wrote and don’t even notice it, like it happened to me. I thought I was crazy because I was sure that I inserted a few words in some line, but it was at the older state.

3 Likes

I can confirm and reproduce this in the help vault. Something is off in the undo stack.

This is tagged “editor-legacy”, but it happens in the new live preview as well.

1 Like

This doesn’t happen in the legacy editor but happens in the new editor.

2 Likes

I came to post exactly this issue. I can also confirm what was written by @dippa420 and @WhiteNoise with version 0.13.19. It took me a bit to figure out why my document was turning into a mess; I tend to type a lot in vi without looking at the screen.

2 Likes

In my case (Linux app, AUR, v.0.13.19) Ctrl+R is also broken, so I cannot revert the extra undo which deleted the information I just typed. It is very damaging to the flow :see_no_evil:

I’m seeing the same behavior, including the Ctrl+R failure that @d-v-romanov is seeing. I don’t think this was happneing on 0.13.14, but I might be wrong.

1 Like

There should be a fix for this in 0.13.20

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.