diff --git a/src/nano.c b/src/nano.c index a542073..68d96f0 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1616,8 +1616,14 @@ int do_input(bool allow_funcs) have_shortcut = (s != NULL); /* If we got a non-high-bit control key, a meta key sequence, or a - * function key, and it's not a shortcut or toggle, throw it out. */ + * function key, and it's not a shortcut or toggle, throw it out. + * Also, don't complain in case controlleft or controlright is in + * input, corresponding functions are already executed. */ if (!have_shortcut) { + if (input == controlleft || input == controlright) + /* Shortcut got handled, so get out */ + //NOTE: we do same when shortcut is fired using click. + return ERR; if (is_ascii_cntrl_char(input) || meta_key || !is_byte(input)) { unbound_key(input); input = ERR; diff --git a/src/winio.c b/src/winio.c index 1b64756..e8a7864 100644 --- a/src/winio.c +++ b/src/winio.c @@ -494,11 +494,13 @@ int parse_kbinput(WINDOW *win) if (retval == ERR) return ERR; - if (retval == controlleft) - return sc_seq_or(do_prev_word_void, 0); - else if (retval == controlright) - return sc_seq_or(do_next_word_void, 0); - else if (retval == controlup) + if (retval == controlleft) { + do_prev_word_void(); + return keycode; + } else if (retval == controlright) { + do_next_word_void(); + return keycode; + } else if (retval == controlup) return sc_seq_or(do_prev_block, 0); else if (retval == controldown) return sc_seq_or(do_next_block, 0);