Adding a new bindable function that writes a file to disk without

first asking for its name.  Patch was suggested by Seiya Nuta.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5318 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg
2015-07-25 19:25:50 +00:00
parent 25c775af21
commit ee7b095678
6 changed files with 38 additions and 2 deletions

View File

@@ -2459,6 +2459,17 @@ void do_writeout_void(void)
display_main_list();
}
#ifndef NANO_TINY
/* If it has a name, write the current file to disk without prompting. */
void do_savefile(void)
{
if (openfile->filename[0] != '\0')
write_file(openfile->filename, NULL, FALSE, OVERWRITE, FALSE);
else
do_writeout_void();
}
#endif
/* Return a malloc()ed string containing the actual directory, used to
* convert ~user/ and ~/ notation. */
char *real_dir_from_tilde(const char *buf)