undotree icon indicating copy to clipboard operation
undotree copied to clipboard

Missing numbers in undohistory

Open PedroVSCoimbra opened this issue 3 years ago • 3 comments

Hello, I was editing a file and going to very old stages in the undo tree. But suddenly I could not see the hole history of changes. The history reset.

2022-05-11-@00-09-48-scrot

It used to show all the changes from 0 to 2600. What could have happened? Can I recover the file in this stated?

PedroVSCoimbra avatar May 11 '22 03:05 PedroVSCoimbra

you might want to check if you have set the undolevels somewhere. It's the maximum number of changes that can be undone. undotree.vim will not touch the undo history unless you type C and then double confirm by typing YES. This is unlikely to happen by accident, so I guess you might have just hit the maximum undo levels.

mbbill avatar May 11 '22 04:05 mbbill

Well, probably. Do you know the behavior when we hit the maximum undo levels? Shouldn't it delete one by one? In my case it delete like 2000 in one go.

I also think that it might have something to do with editing a text what was too early in the history and doing changes there. Is that a possibility?

PedroVSCoimbra avatar May 11 '22 12:05 PedroVSCoimbra

yeah the document for the setting sounds like it should delete the history once hitting the limit and maintaining a sliding window of the newest changes but I haven't tested it, and maybe it works differently in some situations idk. Do you have the undolevels set? or maybe some other plug-ins are messing with it?

mbbill avatar May 11 '22 17:05 mbbill