From 02376103eb5660c91dc64e9d8c057bba82bfe914 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Sun, 9 Apr 2017 16:30:38 -0500 Subject: [PATCH] bindings: use arrows instead of words for search history too When UTF-8 is available, use actual arrows instead of untranslated words to indicate the cursor keys in the search history, as is done elsewhere. --- src/global.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/global.c b/src/global.c index 6affae93..858a78ed 100644 --- a/src/global.c +++ b/src/global.c @@ -1228,9 +1228,17 @@ void shortcut_init(void) add_to_sclist(MGOTOLINE, "^T", 0, gototext_void, 0); #ifndef DISABLE_HISTORIES add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE, "^P", 0, get_history_older_void, 0); - add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE, "Up", KEY_UP, get_history_older_void, 0); add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE, "^N", 0, get_history_newer_void, 0); - add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE, "Down", KEY_DOWN, get_history_newer_void, 0); +#ifdef ENABLE_UTF8 + if (using_utf8()) { + add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE, "\xE2\x86\x91", KEY_UP, get_history_older_void, 0); + add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE, "\xE2\x86\x93", KEY_DOWN, get_history_newer_void, 0); + } else +#endif + { + add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE, "Up", KEY_UP, get_history_older_void, 0); + add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE, "Down", KEY_DOWN, get_history_newer_void, 0); + } #endif #ifndef DISABLE_BROWSER add_to_sclist(MWHEREISFILE, "^Y", 0, do_first_file, 0);