Quit, autosave and interactive save
Quitting calcurse with auto_save on may lead to an interactive conflict resolution for the save operation. When the result is a cancellation of the save, the quit command is also cancelled. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
parent
c95dd0e685
commit
2339d78cbd
@ -509,7 +509,11 @@ static inline void key_generic_scroll_down(void)
|
||||
static inline void key_generic_quit(void)
|
||||
{
|
||||
if (conf.auto_save)
|
||||
io_save_cal(interactive);
|
||||
if (io_save_cal(interactive) == IO_SAVE_CANCEL) {
|
||||
/* Cancel quit as well. */
|
||||
wins_update(FLAG_STA);
|
||||
return;
|
||||
}
|
||||
if (conf.auto_gc)
|
||||
note_gc();
|
||||
|
||||
@ -544,7 +548,12 @@ static inline void key_generic_cmd(void)
|
||||
|
||||
if (!strcmp(cmd_name, "write") || !strcmp(cmd_name, "w") ||
|
||||
!strcmp(cmd_name, "wq")) {
|
||||
io_save_cal(interactive);
|
||||
if (io_save_cal(interactive) == IO_SAVE_CANCEL &&
|
||||
strcmp(cmd_name, "wq") == 0) {
|
||||
/* Cancel quit as well. */
|
||||
wins_update(FLAG_STA);
|
||||
return;
|
||||
}
|
||||
valid = 1;
|
||||
}
|
||||
if (!strcmp(cmd_name, "quit") || !strcmp(cmd_name, "q") ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user