From: Daniel Carl Date: Sat, 22 Dec 2012 18:40:26 +0000 (+0100) Subject: Fixed duplicate hint processing if there exists only one hint item. X-Git-Url: https://git.owens.tech/assets/favicon.png/assets/favicon.png/git?a=commitdiff_plain;h=394abf6def4ec542d63765116b6ae4c3f2d69d3b;p=vimb.git 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. --- 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)