From 871baf52aa5c5a3d0c2e73c26959e202278d40f7 Mon Sep 17 00:00:00 2001 From: dusanx Date: Sun, 3 May 2009 14:49:47 +0200 Subject: Insert mode bugfix --- uzbl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'uzbl.c') diff --git a/uzbl.c b/uzbl.c index 4793dd3..ffae493 100644 --- a/uzbl.c +++ b/uzbl.c @@ -688,7 +688,7 @@ key_press_cb (WebKitWebView* page, GdkEventKey* event) return TRUE; } - if (insert_mode && (event->state & modmask)) + if (insert_mode && ((event->state & modmask) != modmask)) return FALSE; if (event->keyval == GDK_Escape) { -- cgit v1.2.3 From 1825c5b18e7369cf63025ea13ebcf898135bc65b Mon Sep 17 00:00:00 2001 From: dusanx Date: Sun, 3 May 2009 16:58:11 +0200 Subject: Search --- examples/configs/sampleconfig-dev | 1 + uzbl.c | 17 +++++++++++++++++ uzbl.h | 3 +++ 3 files changed, 21 insertions(+) (limited to 'uzbl.c') diff --git a/examples/configs/sampleconfig-dev b/examples/configs/sampleconfig-dev index e9c9cc1..b486660 100644 --- a/examples/configs/sampleconfig-dev +++ b/examples/configs/sampleconfig-dev @@ -44,6 +44,7 @@ B = spawn ./examples/scripts/insert_bookmark.sh u = spawn ./examples/scripts/load_url_from_history.sh U = spawn ./examples/scripts/load_url_from_bookmarks.sh #parameter command examples (all need space but can be removed from individual commands). underscore is important. +/_ = search %s o _ = uri %s :wiki _ = uri http://wiki.archlinux.org/index.php/Special:Search?search=%s&go=Go gg _ = uri http://www.google.com/search?q=%s diff --git a/uzbl.c b/uzbl.c index ffae493..f8cb48f 100644 --- a/uzbl.c +++ b/uzbl.c @@ -70,6 +70,7 @@ static char fifo_path[64]; static char socket_path[108]; static char executable_path[500]; static GString* keycmd; +static gchar searchtx[500] = "\0"; /* state variables (initial values coming from command line arguments but may be changed later) */ static gchar* uri = NULL; @@ -320,6 +321,7 @@ static struct {char *name; Command command;} cmdlist[] = { "toggle_status", toggle_status_cb }, { "spawn", spawn }, { "exit", close_uzbl }, + { "search", search_text }, { "insert_mode", set_insert_mode } }; @@ -387,6 +389,20 @@ load_uri (WebKitWebView * web_view, const gchar *param) { } } +static void +search_text (WebKitWebView *page, const char *param) { + if ((param) && (param[0] != '\0')) { + printf("\nima param!!!\n"); + strcpy(searchtx, param); + } + if (searchtx[0] != '\0') { + printf ("\n\nsearching: %s\n\n", searchtx); + webkit_web_view_mark_text_matches (page, searchtx, FALSE, 0); + webkit_web_view_set_highlight_text_matches (page, TRUE); + webkit_web_view_search_text (page, searchtx, FALSE, TRUE, TRUE); + } +} + static void new_window_load_uri (const gchar * uri) { GString* to_execute = g_string_new (""); @@ -742,6 +758,7 @@ key_press_cb (WebKitWebView* page, GdkEventKey* event) g_string_free (actionparam, TRUE); g_string_free (parampart, TRUE); g_string_truncate(keycmd, 0); + update_title(); } g_string_truncate(short_keys, short_keys->len - 1); diff --git a/uzbl.h b/uzbl.h index d0d6ec7..f9e3053 100644 --- a/uzbl.h +++ b/uzbl.h @@ -116,4 +116,7 @@ add_binding (const gchar *key, const gchar *act); static void settings_init (); +static void +search_text (WebKitWebView *page, const char *param); + /* vi: set et ts=4: */ -- cgit v1.2.3 From 2fc5928e22c1042918860f6e335ba36318f0ebfe Mon Sep 17 00:00:00 2001 From: dusanx Date: Sun, 3 May 2009 17:10:02 +0200 Subject: Small search fix --- uzbl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'uzbl.c') diff --git a/uzbl.c b/uzbl.c index f8cb48f..0c9dc16 100644 --- a/uzbl.c +++ b/uzbl.c @@ -392,11 +392,11 @@ load_uri (WebKitWebView * web_view, const gchar *param) { static void search_text (WebKitWebView *page, const char *param) { if ((param) && (param[0] != '\0')) { - printf("\nima param!!!\n"); strcpy(searchtx, param); } if (searchtx[0] != '\0') { - printf ("\n\nsearching: %s\n\n", searchtx); + printf ("Searching: %s\n", searchtx); + webkit_web_view_unmark_text_matches (page); webkit_web_view_mark_text_matches (page, searchtx, FALSE, 0); webkit_web_view_set_highlight_text_matches (page, TRUE); webkit_web_view_search_text (page, searchtx, FALSE, TRUE, TRUE); -- cgit v1.2.3