I don't understand how the undo line command works.
The documentation says Undo all latest changes on one line.
What is the definition of all latest changes
here?
One behaviour I have noticed is that sometimes U undoes all writes after the very first write on a line. But this is not consistent. For example, when I open a new file and edit the first line, writing multiple times, the U
command undoes every single change.
I haven't been able to find anything concrete from my google searches either.
In my understanding all latest changes means going back the change history until a change in a different line is encountered, and stop there. So if you start with an empty buffer and edit only one line (repeatedly), all additions will be wiped by U
.
Vim generally merges near changes occurring in the same line; these appear as a single entry in :changes
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With