diff options
-rw-r--r-- | src/commands.c | 8 | ||||
-rw-r--r-- | src/commands.h | 1 | ||||
-rw-r--r-- | src/dwb.c | 11 | ||||
-rw-r--r-- | src/dwb.h | 2 |
4 files changed, 16 insertions, 6 deletions
diff --git a/src/commands.c b/src/commands.c index f4b7b06c..ea3ce3ba 100644 --- a/src/commands.c +++ b/src/commands.c @@ -149,6 +149,14 @@ commands_find(KeyMap *km, Arg *arg) { return STATUS_OK; }/*}}}*/ +DwbStatus +commands_search(KeyMap *km, Arg *arg) { + DwbStatus ret = STATUS_OK; + if (!dwb_search(arg)) + ret = STATUS_ERROR; + return ret; +} + /*commands_resize_master {{{*/ DwbStatus commands_resize_master(KeyMap *km, Arg *arg) { diff --git a/src/commands.h b/src/commands.h index 477e9d35..3400a3db 100644 --- a/src/commands.h +++ b/src/commands.h @@ -43,6 +43,7 @@ DwbStatus commands_entry_word_back(KeyMap *, Arg *); DwbStatus commands_entry_word_forward(KeyMap *, Arg *); DwbStatus commands_execute_userscript(KeyMap *, Arg *); DwbStatus commands_find(KeyMap *, Arg *); +DwbStatus commands_search(KeyMap *, Arg *); DwbStatus commands_focus_input(KeyMap *, Arg *); DwbStatus commands_focus(KeyMap *, Arg *); DwbStatus commands_focus_nth_view(KeyMap *, Arg *); @@ -120,9 +120,9 @@ static FunctionMap FMAP [] = { { { "find_forward", "Find forward ", }, CP_COMMANDLINE | CP_HAS_MODE, (Func)commands_find, NO_URL, NEVER_SM, { .b = true }, }, { { "find_next", "Find next", }, 1, - (Func)dwb_search, "No matches", ALWAYS_SM, { .b = true }, }, + (Func)commands_search, "No matches", ALWAYS_SM, { .b = true }, }, { { "find_previous", "Find previous", }, 1, - (Func)dwb_search, "No matches", ALWAYS_SM, { .b = false }, }, + (Func)commands_search, "No matches", ALWAYS_SM, { .b = false }, }, { { "focus_input", "Focus input", }, 1, (Func)commands_focus_input, "No input found in current context", ALWAYS_SM, }, { { "focus_next", "Focus next view", }, CP_COMMANDLINE | CP_HAS_MODE, @@ -2627,7 +2627,8 @@ dwb_update_search(gboolean forward) { /* dwb_search {{{*/ gboolean -dwb_search(KeyMap *km, Arg *arg) { +dwb_search(Arg *arg) { + gboolean ret = false; View *v = CURRENT_VIEW(); gboolean forward = dwb.state.forward_search; if (arg) { @@ -2637,9 +2638,9 @@ dwb_search(KeyMap *km, Arg *arg) { dwb_highlight_search(); } if (v->status->search_string) { - webkit_web_view_search_text(WEBKIT_WEB_VIEW(v->web), v->status->search_string, false, forward, true); + ret = webkit_web_view_search_text(WEBKIT_WEB_VIEW(v->web), v->status->search_string, false, forward, true); } - return true; + return ret; }/*}}}*/ /* dwb_user_script_cb(GIOChannel *, GIOCondition *) return: false {{{*/ @@ -713,7 +713,7 @@ void dwb_prepend_navigation_with_argument(GList **, const char *, const char *); Navigation * dwb_navigation_from_webkit_history_item(WebKitWebHistoryItem *); gboolean dwb_update_hints(GdkEventKey *); -gboolean dwb_search(KeyMap *, Arg *); +gboolean dwb_search(Arg *); void dwb_submit_searchengine(void); void dwb_save_searchengine(void); char * dwb_execute_script(WebKitWebFrame *, const char *, gboolean); |