From 4bfa0b3048cdf77786e3c24bc019c5b0322970d0 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Fri, 20 Dec 2013 00:49:23 +0100 Subject: [PATCH] Leaf hint mode if hint prompt is not valid. --- src/hints.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/hints.c b/src/hints.c index a1c9429..0600ef6 100644 --- a/src/hints.c +++ b/src/hints.c @@ -120,6 +120,17 @@ void hints_create(const char *input) * inputbox on backspace also if there was used a number filter prior */ hints.num = 0; + /* if there is no input or the input is no valid hint mode prefix, clear + * possible previous hint mode */ + if (!input || strlen(input) < 2) { + /* stop hint mode - we switch direct to normal mode that will clear + * the hinting and additional will remove focus from input box */ + if (vb.mode->flags & FLAG_HINTING) { + mode_enter('n'); + } + return; + } + if (!(vb.mode->flags & FLAG_HINTING)) { vb.mode->flags |= FLAG_HINTING; -- 2.20.1