EDIT: Cleaned up handling of file save when opening another file (OA-A)

This commit is contained in:
Bobbi Webber-Manners 2020-09-03 22:49:21 -04:00
parent 75c63c89b6
commit eab93bca09

View File

@ -2466,8 +2466,14 @@ int edit(char *fname) {
break;
case 0x80 + 'O': // OA-O "Open"
case 0x80 + 'o':
if (status[0])
save();
if (status[0]) { // Buffer is modified
if (strlen(filename) == 0)
strcpy(userentry, "Save <scratch> buffer");
else
snprintf(userentry, 80, "Save '%s'", filename);
if (prompt_okay(userentry) == 0)
save();
}
file_ui("Open File", "", openfilemsg);
if (strlen(userentry) == 0) {
draw_screen();