From 199113e143a0dc4b8a242fc51b8735e4c9ac0309 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Sun, 7 May 2017 00:34:51 +0200 Subject: [PATCH] Allow to quit hint mode via #349. There are some pages where the hinting could not be started and the input box is filled with ';o'. If the user uses this key is also given to the hinting mode which can't handle this so the user has no way to get back to normal mode. Moved the case to the beginning of the key handler to make sure the user can abort the current mode by . --- src/ex.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ex.c b/src/ex.c index f558e4c..fde1bb7 100644 --- a/src/ex.c +++ b/src/ex.c @@ -241,6 +241,11 @@ VbResult ex_keypress(Client *c, int key) VbResult res; const char *text; + if (key == CTRL('C')) { + vb_enter(c, 'n'); + return RESULT_COMPLETE; + } + /* delegate call to hint mode if this is active */ if (c->mode->flags & FLAG_HINTING && RESULT_COMPLETE == hints_keypress(c, key)) { @@ -286,7 +291,6 @@ VbResult ex_keypress(Client *c, int key) break; case CTRL('['): - case CTRL('C'): vb_enter(c, 'n'); vb_input_set_text(c, ""); break; -- 2.20.1