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.
This commit is contained in:
Moritz Lipp 2010-04-12 19:57:53 +02:00
parent cc3bb4d494
commit f28700ea46
2 changed files with 15 additions and 2 deletions

View file

@ -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 */

View file

@ -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));