You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The command :w will change the state of a file to 'saved' (removing the [+] symbol), even if the write did not succeed. Because the :q command checks this state before exiting (to prevent losing unsaved work), this bug can cause the :wq command to appear to write and exit successfully when no file was written and all work was lost. The most common cause of a write failing (in my experience) is if the file path includes a directory that does not exist.
Reproduction Steps
Open helix on a file whose path contains nonexistent directories, like this:
hx these/dirs/dont/exist.txt
Write some text. Use the command :w. Note that while an error message is displayed, the "change indicator" ([+]) has disappeared. Write some more text. Use the command :wq. Helix will appear to write and exit successfully, but the specified file will not have been created.
Summary
The command
:w
will change the state of a file to 'saved' (removing the[+]
symbol), even if the write did not succeed. Because the:q
command checks this state before exiting (to prevent losing unsaved work), this bug can cause the:wq
command to appear to write and exit successfully when no file was written and all work was lost. The most common cause of a write failing (in my experience) is if the file path includes a directory that does not exist.Reproduction Steps
Open helix on a file whose path contains nonexistent directories, like this:
Write some text. Use the command
:w
. Note that while an error message is displayed, the "change indicator" ([+]
) has disappeared. Write some more text. Use the command:wq
. Helix will appear to write and exit successfully, but the specified file will not have been created.Helix log
No response
Platform
Linux
Terminal Emulator
WinTerm (WSL2)
Helix Version
helix 22.05-dev (29121a1)
The text was updated successfully, but these errors were encountered: