nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit b18e2129ce9958d4b533f8f5762b534a72952163
parent e26cbdd6cdd6abcbf0612e87202d0558531c6ac5
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon, 13 May 2019 11:21:07 +0200

bindings: bind the Alt+arrow keystrokes also in non-UTF-8 locales

Fall back to using the words "Left", "Right", "Up", and "Down",
instead of graphical arrows.

This fixes https://savannah.gnu.org/bugs/?56313.

Bug was left to exist since the Alt+arrow keys were introduced,
in version 2.8.7, commit 1cc030f7.

Diffstat:
Msrc/global.c | 12+++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/global.c b/src/global.c @@ -1157,6 +1157,10 @@ void shortcut_init(void) add_to_sclist(MMOST|MHELP|MBROWSER, "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); +#ifdef ENABLE_MULTIBUFFER + add_to_sclist(MMAIN, "M-Left", ALT_LEFT, switch_to_prev_buffer, 0); + add_to_sclist(MMAIN, "M-Right", ALT_RIGHT, switch_to_next_buffer, 0); +#endif } #ifdef NANO_TINY add_to_sclist(MMAIN, "M-B", 0, do_prev_word_void, 0); @@ -1194,10 +1198,16 @@ void shortcut_init(void) add_to_sclist(MMAIN, "M-)", 0, do_para_end_void, 0); add_to_sclist(MMAIN, "M-0", 0, do_para_end_void, 0); #endif -#if !defined(NANO_TINY) && defined(ENABLE_UTF8) +#ifndef NANO_TINY +#ifdef ENABLE_UTF8 if (using_utf8()) { add_to_sclist(MMAIN|MHELP, "M-\xE2\x96\xb2", ALT_UP, do_scroll_up, 0); add_to_sclist(MMAIN|MHELP, "M-\xE2\x96\xbc", ALT_DOWN, do_scroll_down, 0); + } else +#endif + { + add_to_sclist(MMAIN|MHELP, "M-Up", ALT_UP, do_scroll_up, 0); + add_to_sclist(MMAIN|MHELP, "M-Down", ALT_DOWN, do_scroll_down, 0); } #endif #if !defined(NANO_TINY) || defined(ENABLE_HELP)