diff options
author | Peter Hofmann <scm@uninformativ.de> | 2017-01-27 18:15:30 +0100 |
---|---|---|
committer | Peter Hofmann <scm@uninformativ.de> | 2017-01-27 18:15:36 +0100 |
commit | 82d5f9e1d3c296512aa5a1dacd9036f2a3857fd8 (patch) | |
tree | 56b4afb9a6584ab10115f898977dcaaf9997c39d | |
parent | f9a96c0acd533e1d546784ca1db14e555bd44dd3 (diff) | |
download | lariza-82d5f9e1d3c296512aa5a1dacd9036f2a3857fd8.tar.gz |
Change search prefix to ":/"
I want to change ensure_uri_scheme() so it automatically adds "file://"
if we're dealing with a valid local file path. However, this clashes
with "/" as a search prefix.
CC #27.
-rw-r--r-- | CHANGES | 5 | ||||
-rw-r--r-- | browser.c | 8 |
2 files changed, 9 insertions, 4 deletions
@@ -1,6 +1,11 @@ Release history for lariza next + [Changed] + - The "search prefix" has been changed from "/" to ":/". This means, + in order to search for text in a web page, you now have to enter + something like ":/your search term" into the input box. + [Added] - An external user-supplied program can be called for the current URI or for hyperlinks/images/videos/audio files. @@ -646,7 +646,7 @@ key_location(GtkWidget *widget, GdkEvent *event, gpointer data) c->web_view)); return TRUE; case GDK_KEY_k: /* initiate search (BOTH hands) */ - gtk_entry_set_text(GTK_ENTRY(c->location), "/"); + gtk_entry_set_text(GTK_ENTRY(c->location), ":/"); gtk_editable_set_position(GTK_EDITABLE(c->location), -1); return TRUE; case GDK_KEY_c: /* reload trusted certs (left hand) */ @@ -669,11 +669,11 @@ key_location(GtkWidget *widget, GdkEvent *event, gpointer data) case GDK_KEY_Return: gtk_widget_grab_focus(c->web_view); t = gtk_entry_get_text(GTK_ENTRY(c->location)); - if (t != NULL && t[0] == '/') + if (t != NULL && t[0] == ':' && t[1] == '/') { if (search_text != NULL) g_free(search_text); - search_text = g_strdup(t + 1); /* XXX whacky */ + search_text = g_strdup(t + 2); /* XXX whacky */ search(c, 0); } else if (!keywords_try_search(WEBKIT_WEB_VIEW(c->web_view), t)) @@ -742,7 +742,7 @@ key_web_view(GtkWidget *widget, GdkEvent *event, gpointer data) return TRUE; case GDK_KEY_k: /* initiate search (BOTH hands) */ gtk_widget_grab_focus(c->location); - gtk_entry_set_text(GTK_ENTRY(c->location), "/"); + gtk_entry_set_text(GTK_ENTRY(c->location), ":/"); gtk_editable_set_position(GTK_EDITABLE(c->location), -1); return TRUE; case GDK_KEY_c: /* reload trusted certs (left hand) */ |