From: Daniel Carl <danielcarl@gmx.de>
Date: Mon, 8 Apr 2013 17:57:56 +0000 (+0200)
Subject: Fixed none shown -- INPUT -- in inputbox.
X-Git-Url: https://git.owens.tech/assets/wrapped.html/assets/wrapped.html/git?a=commitdiff_plain;h=19d37ca49ec46c9b112a2788cebcf8c709976a1e;p=vimb.git

Fixed none shown -- INPUT -- in inputbox.

If Input fields where hinted, the -- INPUT -- was not shown in the inputbox,
because the hinting where not cleared in this case.
---

diff --git a/src/main.c b/src/main.c
index 3bd1321..1a3e9b3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -207,22 +207,23 @@ gboolean vb_set_clipboard(const Arg *arg)
  */
 gboolean vb_set_mode(Mode mode, gboolean clean)
 {
+    /* TODO this function should be implemented easier */
+    int current_mode = CLEAN_MODE(vb.state.mode);
     if ((vb.state.mode & VB_MODE_COMPLETE)
         && !(mode & VB_MODE_COMPLETE)
     ) {
         completion_clean();
+    } else if (current_mode == VB_MODE_HINTING) {
+        /* if previous mode was hinting clear the hints */
+        hints_clear();
     }
-    int current_mode = CLEAN_MODE(vb.state.mode);
     switch (CLEAN_MODE(mode)) {
         case VB_MODE_NORMAL:
             /* do this only if the mode is really switched */
             if (current_mode != VB_MODE_NORMAL) {
                 history_rewind();
             }
-            if (current_mode == VB_MODE_HINTING) {
-                /* if previous mode was hinting clear the hints */
-                hints_clear();
-            } else if (current_mode == VB_MODE_INSERT) {
+            if (current_mode == VB_MODE_INSERT) {
                 /* clean the input if current mode is insert to remove -- INPUT -- */
                 clean = true;
                 dom_clear_focus();