From 9d02cfdc468720a0eb640429e00d6224248bb612 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Fri, 5 Nov 2021 16:25:17 +0100 Subject: [PATCH] [search] document.browse.search.ignore_history . Default 0 When enabled will ignore previous searches in the typeahead mode available by (cursor up, cursor down). --- src/config/options.inc | 5 +++++ src/viewer/text/search.c | 4 ++++ 2 files changed, 9 insertions(+) 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; }