diff --git a/commands.c b/commands.c index 8816b4c..5796e64 100644 --- a/commands.c +++ b/commands.c @@ -286,6 +286,8 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu } bool firsthit = true; + zathura_plugin_error_t error = ZATHURA_PLUGIN_ERROR_OK; + for (unsigned int page_id = 0; page_id < zathura->document->number_of_pages; ++page_id) { zathura_page_t* page = zathura->document->pages[(page_id + zathura->document->current_page_number) % zathura->document->number_of_pages]; if (page == NULL) { @@ -294,11 +296,16 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu g_object_set(page->drawing_area, "draw-links", FALSE, NULL); - girara_list_t* result = zathura_page_search_text(page, input, NULL); + girara_list_t* result = zathura_page_search_text(page, input, &error); if (result == NULL || girara_list_size(result) == 0) { girara_list_free(result); g_object_set(page->drawing_area, "search-results", NULL, NULL); - continue; + + if (error == ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED) { + break; + } else { + continue; + } } g_object_set(page->drawing_area, "search-results", result, NULL);