Open nestor-custodio opened 1 month ago
Worth noting: although a symlink chain 5 files deep is an extremely unlikely and artificial example, I wanted enough files in the chain to show where exactly the break happens.
A more realistic scenario would be a 3 file chain (still unusual, but this does happen) where the last file in the chain is edited (i.e.: "a🡐b🡐c" becomes "a, b🡐c"), breaking the link between the first and second. This is how I actually came across the issue just now.
@pascalkuthe We could try to implement canonicalization like I had suggested in Matrix a while ago, or follow Vim here and do copy backups for symlinks.
Summary
When editing a file opened via a chain of symlinks, a
:w
will write into the file the opened symlink points to, not the actual data source. This breaks the symlink chain, leading to file changes which are essentially orphaned from backup processes, source control, etc.Reproduction Steps
Asciinema recording available here.
I tried this:
I expected this to happen:
Editing "a", "b", "c", "d", or "e" all yield the same end result: "a" is updated.
Instead, this happened:
Editing "e" replaced "d", meaning "d" and "e" no longer reflect the same data as "a", "b", and "c". There are now two versions of this file.
Helix log
(The above actions write no new lines into the Helix log.)
Platform
Linux (Ubuntu 24.04, no DE)
Terminal Emulator
(run in text mode; no terminal emulator)
Installation Method
releases page
Helix Version
helix 24.7 (079f5442)