nano

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

commit 33bc848c5b6348a80c4a691038f137a7aaacd4d1
parent 4c476bc872a80bb180bf10c99d7e4295126b67f4
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Sat, 29 Oct 2016 10:19:28 +0200

binding: properly conditionalize the UTF-8 parts

Reported-by: Sumedh Pendurkar <sumedh.pendurkar@gmail.com>

Diffstat:
Msrc/global.c | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/global.c b/src/global.c @@ -1103,10 +1103,13 @@ void shortcut_init(void) add_to_sclist(MMOST, "Left", KEY_LEFT, do_left, 0); add_to_sclist(MMOST, "^F", 0, do_right, 0); add_to_sclist(MMOST, "Right", KEY_RIGHT, do_right, 0); +#ifdef ENABLE_UTF8 if (using_utf8()) { add_to_sclist(MMOST, "^\xE2\x86\x90", CONTROL_LEFT, do_prev_word_void, 0); add_to_sclist(MMOST, "^\xE2\x86\x92", CONTROL_RIGHT, do_next_word_void, 0); - } else { + } else +#endif + { add_to_sclist(MMOST, "^Left", CONTROL_LEFT, do_prev_word_void, 0); add_to_sclist(MMOST, "^Right", CONTROL_RIGHT, do_next_word_void, 0); } @@ -1120,10 +1123,13 @@ void shortcut_init(void) add_to_sclist(MMAIN|MHELP|MBROWSER, "Up", KEY_UP, do_up_void, 0); add_to_sclist(MMAIN|MHELP|MBROWSER, "^N", 0, do_down_void, 0); add_to_sclist(MMAIN|MHELP|MBROWSER, "Down", KEY_DOWN, do_down_void, 0); +#ifdef ENABLE_UTF8 if (using_utf8()) { add_to_sclist(MMAIN, "^\xE2\x86\x91", CONTROL_UP, do_prev_block, 0); add_to_sclist(MMAIN, "^\xE2\x86\x93", CONTROL_DOWN, do_next_block, 0); - } else { + } else +#endif + { add_to_sclist(MMAIN, "^Up", CONTROL_UP, do_prev_block, 0); add_to_sclist(MMAIN, "^Down", CONTROL_DOWN, do_next_block, 0); }