From 9f52b04f2ae6a4f6695dbdc249a1808a41927072 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Thu, 23 Sep 2021 11:36:26 +0200 Subject: [PATCH] [links] Added bool document.browse.links.show_goto . Refs #127 --- src/config/options.inc | 4 ++++ src/document/options.c | 1 + src/document/options.h | 2 ++ src/viewer/text/view.c | 2 +- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/config/options.inc b/src/config/options.inc index b71f5c02..35548f7f 100644 --- a/src/config/options.inc +++ b/src/config/options.inc @@ -334,6 +334,10 @@ static union option_info config_options_info[] = { "numbering", 0, 0, N_("Display numbers next to the links.")), + INIT_OPT_BOOL("document.browse.links", N_("Show go to link number dialog"), + "show_goto", 0, 1, + N_("Display go to link number dialog, when links numbering is enabled.")), + INIT_OPT_INT("document.browse.links", N_("Handling of target=_blank"), "target_blank", 0, 0, 3, 0, N_("Define how to handle links having target=_blank set:\n" diff --git a/src/document/options.c b/src/document/options.c index 6c6dd632..752eaa9b 100644 --- a/src/document/options.c +++ b/src/document/options.c @@ -87,6 +87,7 @@ init_document_options(struct session *ses, struct document_options *doo) doo->wrap_nbsp = get_opt_bool("document.html.wrap_nbsp", ses); doo->use_tabindex = get_opt_bool("document.browse.links.use_tabindex", ses); doo->links_numbering = get_opt_bool("document.browse.links.numbering", ses); + doo->links_show_goto = get_opt_bool("document.browse.links.show_goto", ses); doo->active_link.enable_color = get_opt_bool("document.browse.links.active_link.enable_color", ses); doo->active_link.invert = get_opt_bool("document.browse.links.active_link.invert", ses); diff --git a/src/document/options.h b/src/document/options.h index 78f5f4b0..5a735f98 100644 --- a/src/document/options.h +++ b/src/document/options.h @@ -115,6 +115,8 @@ struct document_options { unsigned int plain:1; unsigned int wrap:1; + unsigned int links_show_goto:1; + /* XXX: Everything past this comment is specialy handled by compare_opt() */ char *framename; diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c index 14c99dfb..62dcf85c 100644 --- a/src/viewer/text/view.c +++ b/src/viewer/text/view.c @@ -1227,7 +1227,7 @@ try_prefix_key(struct session *ses, struct document_view *doc_view, || ses->kbdprefix.repeat_count /* The user has already begun * entering a prefix. */ || !doc_opts->num_links_key - || (doc_opts->num_links_key == 1 && !doc_opts->links_numbering)) { + || (doc_opts->num_links_key == 1 && (!doc_opts->links_numbering || !doc_opts->links_show_goto))) { int old_count = ses->kbdprefix.repeat_count; int new_count = old_count * 10 + digit;