Making ^O always prompt for a filename, also when --tempfile is given.

Users who want an immediate save, can bind the function 'savefile'.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5489 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg
2015-12-07 17:05:04 +00:00
parent 5d27910d6d
commit cac3c3399f
2 changed files with 6 additions and 10 deletions

View File

@@ -2236,7 +2236,7 @@ bool do_writeout(bool exiting)
#endif
bool retval = FALSE;
if (openfile->filename[0] != '\0' && ISSET(TEMP_FILE)) {
if (exiting && openfile->filename[0] != '\0' && ISSET(TEMP_FILE)) {
retval = write_file(openfile->filename, NULL, FALSE, OVERWRITE,
FALSE);
@@ -2275,14 +2275,6 @@ bool do_writeout(bool exiting)
(append == APPEND) ? _("File Name to Append to") :
_("File Name to Write");
/* If we're not exiting, and the TEMP_FILE flag is set, and
* the current file doesn't have a name, warn the user before
* prompting for a name. If we are exiting, we've already
* warned the user just before the "Save modified buffer"
* prompt, so we don't need to do it again. */
if (!exiting && openfile->filename[0] == '\0' && ISSET(TEMP_FILE))
no_current_file_name_warning();
/* If we're using restricted mode, the filename isn't blank,
* and we're at the "Write File" prompt, disable tab
* completion. */