diff --git a/src/config/options.inc b/src/config/options.inc index 4e93f7931..42d31a93a 100644 --- a/src/config/options.inc +++ b/src/config/options.inc @@ -438,6 +438,11 @@ static union option_info config_options_info[] = { N_("Whether the search should match the document text while " "maintaining case sensitivity.")), + INIT_OPT_BOOL("document.browse.search", N_("Ignore history in typeahead"), + "ignore_history", 0, 0, + N_("Whether to ignore searching history in the typeahead mode. " + "Cursor up and cursor down will only show latest search results.")), + #ifdef CONFIG_TRE INIT_OPT_INT("document.browse.search", N_("Regular expressions"), "regex", 0, 0, 2, 0, diff --git a/src/viewer/text/search.c b/src/viewer/text/search.c index 0358a45be..1d99e664b 100644 --- a/src/viewer/text/search.c +++ b/src/viewer/text/search.c @@ -1832,6 +1832,10 @@ search_typeahead(struct session *ses, struct document_view *doc_view, default: if (doc_view->document->nlinks) { handler = link_typeahead_handler; + + if (get_opt_bool("document.browse.search.ignore_history", NULL)) { + history = NULL; + } break; }