diff options
author | pommicket <pommicket@gmail.com> | 2022-07-29 15:56:32 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-07-29 15:56:32 -0400 |
commit | d9edd1f62fa620d3a8a42c80aec330065b794e14 (patch) | |
tree | 1f19aeabca40196b7987537a7b09f1af30c71c3d /command.c | |
parent | efce2c731927adc4aaf26d6cc6c165bbced39eb5 (diff) |
fixed double ctrl+q problem
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -211,12 +211,13 @@ void command_execute(Ted *ted, Command c, i64 argument) { break; case CMD_QUIT: // pass argument of 2 to override dialog - if (argument == 2) { + if (argument == 2 || ted->warn_unsaved == CMD_QUIT) { ted->quit = true; } else { *ted->warn_unsaved_names = 0; bool *buffers_used = ted->buffers_used; bool first = true; + for (u16 i = 0; i < TED_MAX_BUFFERS; ++i) { if (buffers_used[i]) { buffer = &ted->buffers[i]; @@ -226,6 +227,7 @@ void command_execute(Ted *ted, Command c, i64 argument) { } } } + if (*ted->warn_unsaved_names) { ted->warn_unsaved = CMD_QUIT; menu_open(ted, MENU_WARN_UNSAVED); |