From: Daniel Carl <danielcarl@gmx.de>
Date: Thu, 19 Dec 2013 23:49:23 +0000 (+0100)
Subject: Leaf hint mode if hint prompt is not valid.
X-Git-Url: https://git.owens.tech/assets/112-editable-focus.html/assets/112-editable-focus.html/git?a=commitdiff_plain;h=4bfa0b3048cdf77786e3c24bc019c5b0322970d0;p=vimb.git

Leaf hint mode if hint prompt is not valid.
---

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;