logoalt Hacker News

dtech • today at 5:02 PM • 6 replies • view on HN

The data is stored in ~/.cache which has the contract that it user-wide cached data, which also means it can be deleted without severely impacting programs.

It seems the author has too high expectations of this feature, or vim is using an incorrect path to store this is they want to make it available more reliably


Replies

soraminazuki • today at 7:00 PM

That's some weird technicality that has nothing to do with the issue while also being completely false.

https://github.com/neovim/neovim/blob/fc3f0041fbe01c96f38224...

The feature that was broken is called persistent undo. The feature was inherited from Vim. In case it's not obvious from the name, nowhere does it state in the docs for persistent undo that data may be deleted at any time.

https://neovim.io/doc/user/undo/#persistent-undo

That Neovim changed the default storage path for undo files is completely irrelevant to whether the contract for persistence should be broken.

MatthiasPortzel • today at 6:46 PM

NeoVim docs say it defaults to "$XDG_STATE_HOME/nvim/undo//". Do you have a source for ~/.cache?

=> https://neovim.io/doc/user/options/#'undodir'

buu700 • today at 6:17 PM

This reads to me like a case of blame on both sides. Putting data you don't want to lose in ~/.cache is PEBKAC, but if that fact is incidental and NeoVim would have removed the undo history regardless of its filesystem path, then the point remains valid that NeoVim is deleting user data that isn't its place to delete.

A lot of the comments here are getting caught up in legal arguments which may or may not be valid. Those are irrelevant. No one is taking the NeoVim developers to court; the post is merely warning that they knowingly accepted behavior which can cause harm. The question is whether or not that choice was responsible, not whether it's legally actionable.

wonnage • today at 5:43 PM

So if a program decided it owned .cache and deleted it every startup you’d be fine with it?

➕ show 2 replies