From f28700ea463657b1972b60bf8a96b1731a240c86 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Mon, 12 Apr 2010 19:57:53 +0200 Subject: [PATCH] Activate incremental search This commit reactivates the incremental search and defines that special commands that are set get called all the time an input occurs are not evaluated in the activate section. --- config.def.h | 4 ++-- zathura.c | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/config.def.h b/config.def.h index 35507f7..6ada1b0 100644 --- a/config.def.h +++ b/config.def.h @@ -136,8 +136,8 @@ BufferCommand buffer_commands[] = { /* special commands */ SpecialCommand special_commands[] = { /* identifier, function, a, argument */ - {'/', scmd_search, 0, { DOWN } }, - {'?', scmd_search, 0, { UP } }, + {'/', scmd_search, 1, { DOWN } }, + {'?', scmd_search, 1, { UP } }, }; /* settings */ diff --git a/zathura.c b/zathura.c index fb61c78..d44e897 100644 --- a/zathura.c +++ b/zathura.c @@ -2818,6 +2818,11 @@ cb_index_selection_changed(GtkTreeSelection* treeselection, GtkWidget* action_vi gboolean cb_inputbar_kb_pressed(GtkWidget *widget, GdkEventKey *event, gpointer data) { + /* when the return button is pressed the inputbar is activated, + * so we do not handle it here */ + if(event->keyval == GDK_Return) + return FALSE; + int i; /* inputbar shortcuts */ @@ -2875,6 +2880,14 @@ cb_inputbar_activate(GtkEntry* entry, gpointer data) { if(identifier == special_commands[i].identifier) { + /* special commands that are evaluated every key change are not + * called here */ + if(special_commands[i].always == 1) + { + isc_abort(NULL); + return TRUE; + } + retv = special_commands[i].function(input, &(special_commands[i].argument)); if(retv) isc_abort(NULL); gtk_widget_grab_focus(GTK_WIDGET(Zathura.UI.view));