Implement nohlsearch shortcut

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
Sebastian Ramacher 2018-02-20 23:26:28 +01:00
parent d3e06883f1
commit 9dde3d9d61
3 changed files with 26 additions and 6 deletions

View file

@ -288,12 +288,7 @@ cmd_print(girara_session_t* session, girara_list_t* UNUSED(argument_list))
bool
cmd_nohlsearch(girara_session_t* session, girara_list_t* UNUSED(argument_list))
{
g_return_val_if_fail(session != NULL, false);
g_return_val_if_fail(session->global.data != NULL, false);
zathura_t* zathura = session->global.data;
document_draw_search_results(zathura, false);
render_all(zathura);
sc_nohlsearch(session, NULL, NULL, 0);
return true;
}

View file

@ -1458,3 +1458,16 @@ sc_exec(girara_session_t* session, girara_argument_t* argument, girara_event_t*
return girara_sc_exec(session, argument, event, t);
}
bool
sc_nohlsearch(girara_session_t* session, girara_argument_t* UNUSED(argument), girara_event_t* UNUSED(event), unsigned int UNUSED(t))
{
g_return_val_if_fail(session != NULL, false);
g_return_val_if_fail(session->global.data != NULL, false);
zathura_t* zathura = session->global.data;
document_draw_search_results(zathura, false);
render_all(zathura);
return false;
}

View file

@ -292,4 +292,16 @@ bool sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_even
*/
bool sc_exec(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t);
/**
* Remove search highlights.
*
* @param session The used girara session
* @param argument The used argument
* @param event Girara event
* @param t Number of executions
* @return true if no error occurred otherwise false
*/
bool sc_nohlsearch(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t);
#endif // SHORTCUTS_H