Redraw screen if command prompt is canceled

When pressing escape or entering an empty command, we returned from
key_generic_cmd() without updating the screen. Fix this by creating a
cleanup section at the bottom of key_generic_cmd() and jump to that
section when the command prompt is cancelled.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2013-08-13 12:56:35 +02:00
parent 9eadc19a52
commit 9c1d50eee2

View File

@ -494,7 +494,7 @@ static inline void key_generic_cmd(void)
status_mesg(_("Command:"), ""); status_mesg(_("Command:"), "");
if (getstring(win[STA].p, cmd, BUFSIZ, 0, 1) != GETSTRING_VALID) if (getstring(win[STA].p, cmd, BUFSIZ, 0, 1) != GETSTRING_VALID)
return; goto cleanup;
cmd_name = strtok(cmd, " "); cmd_name = strtok(cmd, " ");
if (cmd_name[strlen(cmd_name) - 1] == '!') { if (cmd_name[strlen(cmd_name) - 1] == '!') {
@ -543,6 +543,7 @@ static inline void key_generic_cmd(void)
warnbox(error_msg); warnbox(error_msg);
} }
cleanup:
wins_update(FLAG_ALL); wins_update(FLAG_ALL);
} }