From fbf46a5d8809a0474eba8f309a2f15215a6be192 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Fri, 28 Apr 2006 18:59:34 +0000 Subject: [PATCH] in do_(statusbar_)?input(), if we get NANO_CONTROL_8, handle it instead of ignoring it, for consistency git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3451 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 6 ++++++ src/nano.c | 18 +++++++++++------- src/prompt.c | 18 +++++++++++------- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index b446d1d2..2eaf100f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -133,10 +133,16 @@ CVS code - - nano.c: renumber() - Remove invalid assert. (DLR, found by Filipe Moreira) + do_input() + - If we get NANO_CONTROL_8, handle it instead of ignoring it, + for consistency. (DLR) - nano.h: - Reorder the toggle #defines to match their corresponding order in toggle_init(). (DLR) - prompt.c: + do_statusbar_input() + - If we get NANO_CONTROL_8, handle it instead of ignoring it, + for consistency. (DLR) get_prompt_string() - Include the handling of the help key even when help is disabled, so that we aren't erroneously kicked out of the diff --git a/src/nano.c b/src/nano.c index 5886adac..a8dc9a04 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1281,16 +1281,20 @@ int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool /* Read in a character. */ input = get_kbinput(edit, meta_key, func_key); + if (allow_funcs) { #ifndef DISABLE_MOUSE - /* If we got a mouse click and it was on a shortcut, read in the - * shortcut character. */ - if (allow_funcs && *func_key == TRUE && input == KEY_MOUSE) { - if (do_mouse()) - input = get_kbinput(edit, meta_key, func_key); + /* If we got a mouse click and it was on a shortcut, read in the + * shortcut character. */ + if (*func_key == TRUE && input == KEY_MOUSE) + input = do_mouse() ? get_kbinput(edit, meta_key, func_key) : + ERR; else - input = ERR; - } #endif + if (input == NANO_CONTROL_8 && *meta_key == FALSE && + *func_key == FALSE) + input = ISSET(REBIND_DELETE) ? NANO_BACKSPACE_KEY : + NANO_DELETE_KEY; + } /* Check for a shortcut in the main list. */ s = get_shortcut(main_list, &input, meta_key, func_key); diff --git a/src/prompt.c b/src/prompt.c index ed9c3c40..c153d4b5 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -68,16 +68,20 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *s_or_t, /* Read in a character. */ input = get_kbinput(bottomwin, meta_key, func_key); + if (allow_funcs) { #ifndef DISABLE_MOUSE - /* If we got a mouse click and it was on a shortcut, read in the - * shortcut character. */ - if (allow_funcs && *func_key == TRUE && input == KEY_MOUSE) { - if (do_statusbar_mouse()) - input = get_kbinput(bottomwin, meta_key, func_key); + /* If we got a mouse click and it was on a shortcut, read in the + * shortcut character. */ + if (*func_key == TRUE && input == KEY_MOUSE) + input = do_statusbar_mouse() ? get_kbinput(bottomwin, + meta_key, func_key) : ERR; else - input = ERR; - } #endif + if (input == NANO_CONTROL_8 && *meta_key == FALSE && + *func_key == FALSE) + input = ISSET(REBIND_DELETE) ? NANO_BACKSPACE_KEY : + NANO_DELETE_KEY; + } /* Check for a shortcut in the current list. */ s = get_shortcut(currshortcut, &input, meta_key, func_key); -- 2.39.5