From 394abf6def4ec542d63765116b6ae4c3f2d69d3b Mon Sep 17 00:00:00 2001
From: Daniel Carl <danielcarl@gmx.de>
Date: Sat, 22 Dec 2012 19:40:26 +0100
Subject: [PATCH] Fixed duplicate hint processing if there exists only one hint
 item.

If there where only one hintable item, the item was fired by the hints_create
function and the hints_changed_callback too. This leads to duplicate input of
the hinted url for the command hint-input-open.
---
 src/hints.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/hints.c b/src/hints.c
index a160240..8e9b9c1 100644
--- a/src/hints.c
+++ b/src/hints.c
@@ -112,7 +112,6 @@ void hints_create(const gchar* input, guint mode, const guint prefixLength)
 {
     Hints* hints = &vp.hints;
     Document* doc;
-    Window* win;
 
     hints_clear();
     hints->mode         = mode;
@@ -123,19 +122,16 @@ void hints_create(const gchar* input, guint mode, const guint prefixLength)
         return;
     }
 
-    /* add event hanlder for inputbox */
-    hints_observe_input(TRUE);
-
-    win = webkit_dom_document_get_default_view(doc);
-
-    hints_create_for_window(input, win, 0);
-
+    hints_create_for_window(input, webkit_dom_document_get_default_view(doc), 0);
     hints_focus(1);
 
     if (g_list_length(hints->list) == 1) {
         /* only one element hinted - we can fire it */
         hints_fire(1);
     }
+
+    /* add event hanlder for inputbox */
+    hints_observe_input(TRUE);
 }
 
 void hints_update(const gulong num)
-- 
2.20.1