Commit 98cc73d3 authored by Moritz Lipp's avatar Moritz Lipp

Added cmd_search

parent 37189ece
......@@ -265,3 +265,19 @@ cmd_savef(girara_session_t* session, girara_list_t* argument_list)
return true;
}
bool
cmd_search(girara_session_t* session, char* input, girara_argument_t* argument)
{
g_return_val_if_fail(session != NULL, false);
g_return_val_if_fail(input != NULL, false);
g_return_val_if_fail(argument != NULL, false);
g_return_val_if_fail(session->global.data != NULL, false);
zathura_t* zathura = session->global.data;
if (zathura->document == NULL) {
return false;
}
return true;
}
......@@ -96,5 +96,14 @@ bool cmd_save(girara_session_t* session, girara_list_t* argument_list);
*/
bool cmd_savef(girara_session_t* session, girara_list_t* argument_list);
/**
* Search the current file
*
* @param session The used girara session
* @param input The current input
* @param argument Passed argument
* @return true if no error occured
*/
bool cmd_search(girara_session_t* session, char* input, girara_argument_t* argument);
#endif // COMMANDS_H
......@@ -122,6 +122,9 @@ config_load_default(zathura_t* zathura)
girara_inputbar_command_add(gsession, "write", NULL, cmd_save, NULL, "Save document");
girara_inputbar_command_add(gsession, "write!", NULL, cmd_savef, NULL, "Save document (and force overwriting)");
girara_special_command_add(gsession, '/', cmd_search, true, FORWARD, NULL);
girara_special_command_add(gsession, '?', cmd_search, true, BACKWARD, NULL);
/* add shortcut mappings */
girara_shortcut_mapping_add(gsession, "abort", sc_abort);
girara_shortcut_mapping_add(gsession, "adjust_window", sc_adjust_window);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment