diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-30 13:36:03 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-30 13:36:03 -0500 |
commit | 2994bf93de60930af3855db7a230c27be77de4ef (patch) | |
tree | cdcfe86c1fbb0cab8752e53dc47b3154266b407f /menu.c | |
parent | b35a780479bbf5038a825d415f9ca49c92f6b425 (diff) |
middle click to close tab
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -128,12 +128,14 @@ static void menu_update(Ted *ted, Menu menu) { case POPUP_YES: // save changes switch (ted->warn_unsaved) { - case CMD_TAB_CLOSE: + case CMD_TAB_CLOSE: { menu_close(ted, true); - if (buffer_save(ted->prev_active_buffer)) { + TextBuffer *buffer = ted->active_buffer; + command_execute(ted, CMD_SAVE, 1); + if (!buffer_unsaved_changes(buffer)) { command_execute(ted, CMD_TAB_CLOSE, 1); } - break; + } break; case CMD_QUIT: menu_close(ted, true); if (ted_save_all(ted)) { |