diff --git a/zathura/commands.c b/zathura/commands.c index 42711b5..e259b22 100644 --- a/zathura/commands.c +++ b/zathura/commands.c @@ -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; } diff --git a/zathura/shortcuts.c b/zathura/shortcuts.c index ae3a469..11ca04e 100644 --- a/zathura/shortcuts.c +++ b/zathura/shortcuts.c @@ -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; +} diff --git a/zathura/shortcuts.h b/zathura/shortcuts.h index 195554a..c1b19ad 100644 --- a/zathura/shortcuts.h +++ b/zathura/shortcuts.h @@ -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