summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hofmann <scm@uninformativ.de>2017-01-27 18:15:30 +0100
committerPeter Hofmann <scm@uninformativ.de>2017-01-27 18:15:36 +0100
commit82d5f9e1d3c296512aa5a1dacd9036f2a3857fd8 (patch)
tree56b4afb9a6584ab10115f898977dcaaf9997c39d
parentf9a96c0acd533e1d546784ca1db14e555bd44dd3 (diff)
downloadlariza-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--CHANGES5
-rw-r--r--browser.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index 8a670ee..4ae5130 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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.
diff --git a/browser.c b/browser.c
index e0b45c1..3cf7d60 100644
--- a/browser.c
+++ b/browser.c
@@ -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) */