Skip to content
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

Existing files are overwritten without confirmation #20

Closed
jooadam opened this issue Aug 23, 2016 · 6 comments
Closed

Existing files are overwritten without confirmation #20

jooadam opened this issue Aug 23, 2016 · 6 comments

Comments

@jooadam
Copy link
Contributor

jooadam commented Aug 23, 2016

Selecting an existing file when saving a document the existing file is overwritten without asking for confirmation. This makes it really easy to accidentally destroy files.

@vigna
Copy link
Owner

vigna commented Aug 29, 2016

Well, that's a bit the UN*X way—if you mv a file over an existing file it won't ask for confirmation. Frankly, I never deleted a single file in this particular way.

@jooadam
Copy link
Contributor Author

jooadam commented Aug 29, 2016

That’s a valid point of view, but if you prompt the user when an unsaved buffer is about to be closed, then I’d argue that you have already committed not to carry out destructive operations without confirmation.

I’ve been using Unixes for a decade now, and I cannot recall any instance of loosing work for lack of confirmation on the command line, but I had to restore from backup multiple times working with ne.

@utoddl
Copy link
Collaborator

utoddl commented Aug 29, 2016

I think there may be a way to extend the technique we use wrt file modification times to help in this case. But I want to be sure I understand the scenario you're describing @jooadam. Are you talking about saving an unnamed buffer, and/or SaveAs, with the name of an existing, unrelated file?

@jooadam
Copy link
Contributor Author

jooadam commented Aug 29, 2016

@utoddl yep, that’s the scenario.

@utoddl
Copy link
Collaborator

utoddl commented Aug 29, 2016

It does warn now when SaveAs would overwrite an existing file. This is for buffers only, not streams, so SaveClip and SaveMacro are still "dangerous". Please test.

@jooadam
Copy link
Contributor Author

jooadam commented Aug 29, 2016

Great!

@utoddl utoddl closed this as completed Sep 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants