-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doing a Git stash, or anything git related deletes the entire undo tree #146
Comments
Thank god I had an opened nvim and I managed to recover this file... Why is it that if I close nvim , do some git actions and then open it the undofile gets competely deleted? I cant find anything about this behavior online |
Glad to hear you've got your data back. I've been there and I know how it feels when important data got lost like that. I think it's an VIM internal behavior but I can't find anywhere mention it in the vim documents. I did find some user wikis mentioned it though, e.g. https://vim.fandom.com/wiki/Using_undo_branches
One of the safeguard is to enable the backup file. I personally do not use it as I'm aware of the above mentioned behavior but you can try if you're unsure. |
So how do you prevent these issues?
I found that page and I enabled this backup stuff and swap files just in
case.
…On Fri, Jan 27, 2023, 21:37 Ming, Bai ***@***.***> wrote:
Glad to hear you've got your data back. I've been there and I know how it
feels when important data got lost like that. I think it's an VIM internal
behavior but I can't find anywhere mention it in the vim documents. I did
find some user wikis mentioned it though, e.g.
https://vim.fandom.com/wiki/Using_undo_branches
However, note that if a file is modified externally without Vim, Vim will
not be able to read the undo history back when you start editing the file
again and the undo tree information will be lost. There is no way to get it
back.
One of the safeguard is to enable the backup file. I personally do not use
it as I'm aware of the above mentioned behavior but you can try if you're
unsure.
—
Reply to this email directly, view it on GitHub
<#146 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD7WGR5JOMTEACJ7ARPROHTWUQ5YTANCNFSM6AAAAAAUI2RMUI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
You mean me or the undotree plugin? |
You because from what I understand there's nothing the plug-in can do right?
…On Sat, Jan 28, 2023, 01:11 Ming, Bai ***@***.***> wrote:
So how do you prevent these issues? I found that page and I enabled this
backup stuff and swap files just in case.
You mean me or the undotree plugin?
—
Reply to this email directly, view it on GitHub
<#146 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD7WGRZUE3C3W2HLB3MROWDWURW35ANCNFSM6AAAAAAUI2RMUI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
That's right. |
I have lost hours of work because of this in the past and it continues to happen.
It super frustrating, I know need to re-write an entire file which is going to delay my work.
I dont understand why doing any kind of git movements like git stash or git checkout etc completely deletes the undotree.
Is there something you can do to prevent this on your side?
The text was updated successfully, but these errors were encountered: