commit 10d9742c11ca089da69b85faaad9e1b83c31bc62
parent 2a894213e0f8bff7116db1bd4c168df3b305a826
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Tue, 2 Oct 2018 19:59:59 +0200
display: show the cursor also in a help text (when --showcursor is used)
The cursor can function as a reading aid for people with poor vision.
This fulfills https://savannah.gnu.org/bugs/?54654.
Requested-by: Ben Key <benk1976@yahoo.com>
Diffstat:
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/global.c b/src/global.c
@@ -1168,8 +1168,8 @@ void shortcut_init(void)
add_to_sclist(MMOST, "^F", 0, do_right, 0);
#ifdef ENABLE_UTF8
if (using_utf8()) {
- add_to_sclist(MMOST, "\xE2\x97\x80", KEY_LEFT, do_left, 0);
- add_to_sclist(MMOST, "\xE2\x96\xb6", KEY_RIGHT, do_right, 0);
+ add_to_sclist(MMOST|MHELP, "\xE2\x97\x80", KEY_LEFT, do_left, 0);
+ add_to_sclist(MMOST|MHELP, "\xE2\x96\xb6", KEY_RIGHT, do_right, 0);
add_to_sclist(MSOME, "^\xE2\x97\x80", CONTROL_LEFT, do_prev_word_void, 0);
add_to_sclist(MSOME, "^\xE2\x96\xb6", CONTROL_RIGHT, do_next_word_void, 0);
#ifdef ENABLE_MULTIBUFFER
@@ -1183,8 +1183,8 @@ void shortcut_init(void)
} else
#endif
{
- add_to_sclist(MMOST, "Left", KEY_LEFT, do_left, 0);
- add_to_sclist(MMOST, "Right", KEY_RIGHT, do_right, 0);
+ add_to_sclist(MMOST|MHELP, "Left", KEY_LEFT, do_left, 0);
+ add_to_sclist(MMOST|MHELP, "Right", KEY_RIGHT, do_right, 0);
add_to_sclist(MSOME, "^Left", CONTROL_LEFT, do_prev_word_void, 0);
add_to_sclist(MSOME, "^Right", CONTROL_RIGHT, do_next_word_void, 0);
}
diff --git a/src/help.c b/src/help.c
@@ -183,13 +183,16 @@ void do_help(void)
focusing = TRUE;
/* Show the cursor when we searched and found something. */
- kbinput = get_kbinput(edit, didfind == 1);
+ kbinput = get_kbinput(edit, didfind == 1 || ISSET(SHOW_CURSOR));
didfind = 0;
func = parse_help_input(&kbinput);
if (func == total_refresh) {
total_redraw();
+ } else if (ISSET(SHOW_CURSOR) && (func == do_left || func == do_right ||
+ func == do_up || func == do_down)) {
+ func();
} else if (func == do_up) {
do_scroll_up();
} else if (func == do_down) {