-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
:wq! should not quit (and lose the changes) if there are no permissions to write the file #2864
Comments
This may be an issue of semantics? My expectation would be that the |
Hmm yeah it's a bit murky - I would say we should interperate the Based on the behavior of kakoune and vim, I think
|
This seems inconsistent though. Why is it that the command would care about losing changes to the current buffer, but we don't care about every other buffer? Like what if you have one file read only and one you do have permissions for, and you modify both, and then The way I see it, either you care about losing changes or you don't. |
For caring about other buffers than the focused view we have For me it's a fairly common workflow to temporarily modify a few files (usually at least a scratch buffer) and then edit the main file I care about, ending the session with |
Yeah that's a good point. If no one picks this up before I get to it, I can include a fix for this in #2267. Should be a quick change. |
In vim, I personally tend to forget about other buffers or even about saving them. In Vim, even with Yes, helix Also, note that it is unclear what the Scenario 1: I'm running Scenario 2: I'm running Therefore I really think whatever the behaviour of |
Yeah, and actually thinking some more about @the-mikedavis 's case with scratch buffers, the use case might be different. Losing changes in a scratch buffer is not the same as losing changes to a file on disk. Actually, I believe kakoune does not stop from quitting if there are unsaved changes in a scratch buffer even without the I think maybe the core of the issue is the user's expectation of what the
@archseer any thoughts? |
Summary
I cannot reopen #1575 - but I think the way it was fixed is wrong.
Now `:wq!' still exits when it can't write the file, losing the changes. I think it shouldn't exit. vim doesn't exit.
Reproduction Steps
I tried this:
hx /etc/hosts
- should be a file without permissions to write it:wq!
I expected this to happen:
editor displays an error message about the permission issue and it stays in the editor, just like vim.
Instead, this happened:
editor displays an error message about the permission issue and exits, losing all the changes
Helix log
No response
Platform
Linux, zsh.
Terminal Emulator
terminator
Helix Version
helix 22.05 (c107f4e)
The text was updated successfully, but these errors were encountered: