Abort search if page_search_text is not implemented

This commit is contained in:
Moritz Lipp 2012-02-18 09:21:34 +01:00
parent 8fdf18b088
commit bf0bb66503

View File

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