diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-29 17:51:49 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-29 17:51:49 -0500 |
commit | a0b84cc8f40e19a506332be3a05222b87e6ed617 (patch) | |
tree | 68607facee3bb655cfe2166d4a578db9e91bdf1f /command.c | |
parent | 565b5e619ed64f459f1b38b5b94bb72b5b9a714f (diff) |
better tab bar, default to "save as" on Ctrl+S with starting buffer
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -141,9 +141,16 @@ void command_execute(Ted *ted, Command c, i64 argument) { menu_open(ted, MENU_OPEN); break; case CMD_SAVE: - if (buffer) buffer_save(buffer); + if (buffer) { + if (buffer->filename && streq(buffer->filename, "Untitled")) { + // don't worry, this won't catch files called "Untitled"; buffer->filename is the full path. + goto save_as; + } + buffer_save(buffer); + } break; case CMD_SAVE_AS: + save_as: if (buffer && !buffer->is_line_buffer) { menu_open(ted, MENU_SAVE_AS); } |