From 4e1c627d3a0b93556f2e9eae3cb96c4272402151 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Sat, 22 Dec 2012 16:58:03 +0100 Subject: [PATCH] Fixed reseted prefixLength for the hints. The prefixLength was set back to zero on call of hints_clear so that hinting with chars didn't work properly. Now the prefixLength is alway given as parameter to the function hints_create. --- src/hints.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/hints.c b/src/hints.c index 2760977..a160240 100644 --- a/src/hints.c +++ b/src/hints.c @@ -115,12 +115,8 @@ void hints_create(const gchar* input, guint mode, const guint prefixLength) Window* win; hints_clear(); - hints->mode = mode; - - /* don't overwrite if zero */ - if (prefixLength) { - hints->prefixLength = prefixLength; - } + hints->mode = mode; + hints->prefixLength = prefixLength; doc = webkit_web_view_get_dom_document(WEBKIT_WEB_VIEW(vp.gui.webview)); if (!doc) { @@ -151,7 +147,7 @@ void hints_update(const gulong num) if (num == 0) { /* recreate the hints */ - hints_create(NULL, hints->mode, 0); + hints_create(NULL, hints->mode, hints->prefixLength); return; } @@ -514,7 +510,7 @@ static gboolean hints_changed_callback(GtkEditable *entry, gpointer data) const gchar* text = GET_TEXT(); /* skip hinting prefixes like '.', ',', ';y' ... */ - hints_create(text + vp.hints.prefixLength, vp.hints.mode, 0); + hints_create(text + vp.hints.prefixLength, vp.hints.mode, vp.hints.prefixLength); return TRUE; } -- 2.20.1