diff options
-rw-r--r-- | core/suggestion-row.vala | 2 | ||||
-rw-r--r-- | core/urlbar.vala | 16 |
2 files changed, 7 insertions, 11 deletions
diff --git a/core/suggestion-row.vala b/core/suggestion-row.vala index 0f427c3c..e8027cde 100644 --- a/core/suggestion-row.vala +++ b/core/suggestion-row.vala @@ -42,7 +42,7 @@ namespace Midori { } }); notify["key"].connect ((pspec) => { - if (key != null) { + if (location == null) { var suggestion = (SuggestionItem)item; item.uri = CoreSettings.get_default ().uri_for_search (key, suggestion.search); icon.icon_name = "edit-find-symbolic"; diff --git a/core/urlbar.vala b/core/urlbar.vala index 20f2db23..b7b0aae4 100644 --- a/core/urlbar.vala +++ b/core/urlbar.vala @@ -165,18 +165,14 @@ namespace Midori { void update_key (string text) { location = magic_uri (text); - if (location == null) { - try { - key = text; - regex = new Regex ("(%s)".printf (Regex.escape_string (key)), - RegexCompileFlags.CASELESS); - } catch (RegexError error) { - debug ("Failed to create regex: %s", error.message); - } - } else { + try { + key = text; + regex = new Regex ("(%s)".printf (Regex.escape_string (key)), + RegexCompileFlags.CASELESS); + } catch (RegexError error) { regex = null; + debug ("Failed to create regex: %s", error.message); } - } string? magic_uri (string text) { |