summaryrefslogtreecommitdiff
path: root/finch/libgnt/gntentry.c
diff options
context:
space:
mode:
Diffstat (limited to 'finch/libgnt/gntentry.c')
-rw-r--r--finch/libgnt/gntentry.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/finch/libgnt/gntentry.c b/finch/libgnt/gntentry.c
index 97fb32cff9..29db9a61c2 100644
--- a/finch/libgnt/gntentry.c
+++ b/finch/libgnt/gntentry.c
@@ -480,8 +480,7 @@ history_search(GntBindable *bind, GList *null)
{
GntEntry *entry = GNT_ENTRY(bind);
GList *iter;
- const char *current , *pos;
- int len;
+ const char *current;
if (entry->history->prev && entry->search->needle)
current = entry->search->needle;
@@ -491,13 +490,11 @@ history_search(GntBindable *bind, GList *null)
if (!entry->histlength || !entry->history->next || !*current)
return FALSE;
- len = g_utf8_strlen(current, -1);
-
for (iter = entry->history->next; iter; iter = iter->next) {
const char *str = iter->data;
/* A more utf8-friendly version of strstr would have been better, but
* for now, this will have to do. */
- if ((pos = strstr(str, current)))
+ if (strstr(str, current) != NULL)
break;
}
@@ -579,6 +576,28 @@ suggest_prev(GntBindable *bind, GList *null)
}
static gboolean
+suggest_next_page(GntBindable *bind, GList *null)
+{
+ GntEntry *entry = GNT_ENTRY(bind);
+ if (entry->ddown) {
+ gnt_bindable_perform_action_named(GNT_BINDABLE(entry->ddown), "page-down", NULL);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static gboolean
+suggest_prev_page(GntBindable *bind, GList *null)
+{
+ GntEntry *entry = GNT_ENTRY(bind);
+ if (entry->ddown) {
+ gnt_bindable_perform_action_named(GNT_BINDABLE(entry->ddown), "page-up", NULL);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static gboolean
del_to_home(GntBindable *bind, GList *null)
{
GntEntry *entry = GNT_ENTRY(bind);
@@ -986,6 +1005,10 @@ gnt_entry_class_init(GntEntryClass *klass)
GNT_KEY_DOWN, NULL);
gnt_bindable_class_register_action(bindable, "suggest-prev", suggest_prev,
GNT_KEY_UP, NULL);
+ gnt_bindable_class_register_action(bindable, "suggest-next-page", suggest_next_page,
+ GNT_KEY_PGDOWN, NULL);
+ gnt_bindable_class_register_action(bindable, "suggest-prev-page", suggest_prev_page,
+ GNT_KEY_PGUP, NULL);
gnt_bindable_class_register_action(bindable, "history-next", history_next,
GNT_KEY_CTRL_DOWN, NULL);
gnt_bindable_class_register_action(bindable, "history-prev", history_prev,