nano

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

commit b4428a0268bd4eec2d5181daa82634157e1ab3ec
parent 592f46bf35133aea1264ffe7133ef8ce6a8fff29
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Wed, 24 May 2006 18:10:41 +0000

fix breakage


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3556 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

Diffstat:
Msrc/nano.c | 11+++++++----
Msrc/prompt.c | 20++++++++++++--------
Msrc/winio.c | 4++--
3 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/src/nano.c b/src/nano.c @@ -1298,12 +1298,15 @@ int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool ); /* If we got a non-high-bit control key or a meta key sequence, and - * it's not a shortcut or toggle, ignore it, and indicate this on - * the statusbar. */ + * it's not a shortcut or toggle, ignore it. If it's a meta key + * sequence, throw it out completely, so that we don't end up + * inserting its second character as though it were typed. */ if (*s_or_t == FALSE) { if (is_ascii_cntrl_char(input) || *meta_key == TRUE) { - input = ERR; - *meta_key = FALSE; + if (*meta_key == TRUE) { + *meta_key = FALSE; + input = ERR; + } statusbar(_("Unknown Command")); } } diff --git a/src/prompt.c b/src/prompt.c @@ -82,11 +82,11 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *s_or_t, /* If we got a shortcut from the current list, or a "universal" * statusbar prompt shortcut, set have_shortcut to TRUE. */ - have_shortcut = (s != NULL || input == NANO_REFRESH_KEY || - input == NANO_HOME_KEY || input == NANO_END_KEY || - input == NANO_BACK_KEY || input == NANO_FORWARD_KEY || - input == NANO_BACKSPACE_KEY || input == NANO_DELETE_KEY || - input == NANO_CUT_KEY || + have_shortcut = (s != NULL || input == NANO_REFRESH_KEY || input == + NANO_HOME_KEY || input == NANO_END_KEY || input == + NANO_BACK_KEY || input == NANO_FORWARD_KEY || input == + NANO_BACKSPACE_KEY || input == NANO_DELETE_KEY || input == + NANO_CUT_KEY || #ifndef NANO_TINY input == NANO_NEXTWORD_KEY || #endif @@ -100,11 +100,15 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *s_or_t, *s_or_t = have_shortcut; /* If we got a non-high-bit control key or a meta key sequence, and - * it's not a shortcut or toggle, ignore it. */ + * it's not a shortcut or toggle, ignore it. If it's a meta key + * sequence, throw it out completely, so that we don't end up + * inserting its second character as though it were typed. */ if (*s_or_t == FALSE) { if (is_ascii_cntrl_char(input) || *meta_key == TRUE) { - input = ERR; - *meta_key = FALSE; + if (*meta_key == TRUE) { + *meta_key = FALSE; + input = ERR; + } } } diff --git a/src/winio.c b/src/winio.c @@ -536,8 +536,8 @@ int parse_kbinput(WINDOW *win, bool *meta_key, bool *func_key) &ignore_seq); /* If the escape sequence is unrecognized and - * not ignored, indicate this on the - * statusbar. */ + * not ignored, throw it out completely and + * indicate this on the statusbar. */ if (retval == ERR && !ignore_seq) statusbar(_("Unknown Command"));