diff options
author | Marco Peereboom <marco@conformal.com> | 2011-10-06 15:52:15 -0500 |
---|---|---|
committer | Marco Peereboom <marco@conformal.com> | 2011-10-06 15:52:15 -0500 |
commit | 090bc388080187aca96c2ac70b3b36af6a725967 (patch) | |
tree | 754e1eb2f53ebdb6049efc9e04534c49ebba67a6 | |
parent | 48c99ae40c6188e3c289172e58be38912749ac36 (diff) | |
download | xombrero-090bc388080187aca96c2ac70b3b36af6a725967.tar.gz |
fix search direction on new page
When on a new page a search is resumed the search used to go backward instead of forward. This has been plenty irritating for a while.
-rw-r--r-- | xxxterm.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/xxxterm.c b/xxxterm.c index 15357d5..5da6079 100644 --- a/xxxterm.c +++ b/xxxterm.c @@ -5087,16 +5087,29 @@ xtp_page_dl(struct tab *t, struct karg *args) int search(struct tab *t, struct karg *args) { - gboolean d; + gboolean d; if (t == NULL || args == NULL) { show_oops(NULL, "search invalid parameters"); return (1); } + + switch (args->i) { + case XT_SEARCH_NEXT: + d = t->search_forward; + break; + case XT_SEARCH_PREV: + d = !t->search_forward; + break; + default: + return (XT_CB_PASSTHROUGH); + } + if (t->search_text == NULL) { if (global_search == NULL) return (XT_CB_PASSTHROUGH); else { + d = t->search_forward = TRUE; t->search_text = g_strdup(global_search); webkit_web_view_mark_text_matches(t->wv, global_search, FALSE, 0); webkit_web_view_set_highlight_text_matches(t->wv, TRUE); @@ -5106,17 +5119,6 @@ search(struct tab *t, struct karg *args) DNPRINTF(XT_D_CMD, "search: tab %d opc %d forw %d text %s\n", t->tab_id, args->i, t->search_forward, t->search_text); - switch (args->i) { - case XT_SEARCH_NEXT: - d = t->search_forward; - break; - case XT_SEARCH_PREV: - d = !t->search_forward; - break; - default: - return (XT_CB_PASSTHROUGH); - } - webkit_web_view_search_text(t->wv, t->search_text, FALSE, d, TRUE); return (XT_CB_HANDLED); |