Skip to content

Commit

Permalink
Display error messages in console when trying to use unconfigured ext…
Browse files Browse the repository at this point in the history
…ernal search engines
  • Loading branch information
ahrm committed Dec 13, 2022
1 parent 4dd7676 commit e055a82
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pdf_viewer/main_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,12 @@ bool MainWidget::handle_command_with_symbol(const Command* command, char symbol)
}
else if (command->name == "external_search") {
if ((symbol >= 'a') && (symbol <= 'z')) {
search_custom_engine(selected_text, SEARCH_URLS[symbol - 'a']);
if (SEARCH_URLS[symbol - 'a'].size() > 0) {
search_custom_engine(selected_text, SEARCH_URLS[symbol - 'a']);
}
else {
std::wcout << L"No search engine defined for symbol " << symbol << std::endl;
}
}
//if (opengl_widget->selected_character_rects.size() > 0) {
// main_document_view->add_highlight({ selection_begin_x, selection_begin_y }, { selection_end_x, selection_end_y }, symbol);
Expand Down

0 comments on commit e055a82

Please sign in to comment.