From 8994191d288b79795a2ae7cad7e5abf91b2b4080 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Thu, 4 Dec 2014 23:33:05 +0100 Subject: [PATCH] Don't give key presses to hint mode if this is off. If commands where typed into inputbox, there where javaScript errors written in case a ';' was typed. The decision when the hinting mode is active was wrong. Hinting is always started explicit so we can check the mode flag to decide if the key can be handled by the hinting mode. --- src/ex.c | 6 ++++-- src/hints.c | 6 ------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/ex.c b/src/ex.c index 4858427..1290df2 100644 --- a/src/ex.c +++ b/src/ex.c @@ -247,8 +247,10 @@ VbResult ex_keypress(int key) VbResult res; const char *text; - /* delegate call to the submode */ - if (RESULT_COMPLETE == hints_keypress(key)) { + /* delegate call to hint mode if this is active */ + if (vb.mode->flags & FLAG_HINTING + && RESULT_COMPLETE == hints_keypress(key)) { + return RESULT_COMPLETE; } diff --git a/src/hints.c b/src/hints.c index 9dec4ad..2482522 100644 --- a/src/hints.c +++ b/src/hints.c @@ -70,12 +70,6 @@ VbResult hints_keypress(int key) { JSValueRef arguments[1]; - /* if we are not already in hint mode we expect to get a ; to start - * hinting */ - if (!(vb.mode->flags & FLAG_HINTING) && key != ';') { - return RESULT_ERROR; - } - if (key == KEY_CR) { hints_fire(); -- 2.20.1