Remix.run Logo
▲ RVuRnvbM2e 44 minutes ago

Undo files and persistent undo are not meant to work that way. They are just persistent across process restarts. That's all.

They live in ~/.cache which is defined as "user-specific non-essential (cached) data".

Despite this user's impressive résumé, they simply misunderstood the feature.

▲freehorse 36 minutes ago | parent | next [-]

What did OP misunderstand? I am not sure how and where their understanding of "persistent undo" is different from "persistent across process restarts"?

▲kazinator 31 minutes ago | parent | prev [-]

In what way is it not a process restart if I stop the process, install/upgrade NeoVim and start a new process?

▲RVuRnvbM2e 4 minutes ago | parent | next [-]

It's the part where you upgraded and apparently failed to read the release notes.

Or in the OPs case, installed a totally different application and was surprised by an incompatibility.

▲tremon 12 minutes ago | parent | prev [-]

The life time of files in ~/.cache/ is the same as what the FHS documents for /var/cache [0]:

> Application cache data. Such data are locally generated as a result of time-consuming I/O or calculation. The application must be able to regenerate or restore the data. The cached files can be deleted without loss of data.

Meaning: the persistence of such files is not guaranteed across application restarts. If vim (and also neovim) had intended for the undo files to outlive the program, the files should have been put in ~/.local/state instead -- as also explicitly documented by the XDG [1]:

> [XDG_STATE_HOME] may contain: [..] current state of the application that can be reused on a restart (view, layout, open files, undo history, …)

[0] https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard#...

[1] https://specifications.freedesktop.org/basedir/latest/#varia...