-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[BUG 100% reproducible] Crash when creating non-existing file without permissions for it #3080
Comments
The problem is in two functions: SaveAsCB and saveBufToFile As said in stacktrace error is caused on line 805: micro/internal/action/actions.go Line 805 in d8e9d61
micro/internal/action/actions.go Lines 794 to 803 in d8e9d61
|
The logic of checks is separate between two functions. One tries to check if file exist another tries to check if user have permissions for the file. One of them calls another. Looks like we have two checks and everything should work normally but it isn't so. I don't like this code. And Callbacks they are messy here... I think logic of checks should be in one place not in two and that it should be flattened off callbacks (but it looks like prompting architecture doesn't allow it) |
You can't save file when it doesn't exist but you have permissions? You described in issue (and I checked it is really so) that error occurs when you try to save non existing file without permissions for it. I would recommend the following issue name: |
micro/internal/action/actions.go Lines 803 to 814 in d8e9d61
Why not simply adding an Because if I understood the code from |
Do you mean: } else {
InfoBar.YNPrompt(
//.....
)
}
P.S If you want to embed the code not just link, you need to strip |
Ok, next time. The GitHub help wasn't sufficient for that.
Yes.
Because then I'd expect |
Description of the problem or steps to reproduce
As the title says, attempting to create a new file which requires sudo permissions to save, results in the above error.
Note that I have the
"mkparents": true
option enabled.Specifications
Commit hash: 68d88b5
OS: ArchLinux
Terminal: Konsole
The text was updated successfully, but these errors were encountered: