From 8e4b68917c9e73a77bd2ae64f9d8f7ff668dc54a Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 12 Feb 2020 14:15:35 +0100 Subject: [PATCH] tweaks: rename a function, and condense a few comments --- src/nano.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/nano.c b/src/nano.c index b9b10b55..6f0064d9 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1492,9 +1492,8 @@ void suck_up_input_and_paste_it(void) } #endif -/* Read in a keystroke. Act on the keystroke if it is a shortcut or a toggle; - * otherwise, insert it into the edit buffer. */ -void do_input(void) +/* Read in a keystroke, and execute its command or insert it into the buffer. */ +void process_a_keystroke(void) { int input; /* The keystroke we read in: a character or a shortcut. */ @@ -1511,16 +1510,13 @@ void do_input(void) if (input == KEY_WINCH) return; #endif - #ifdef ENABLE_MOUSE if (input == KEY_MOUSE) { - /* We received a mouse click. */ + /* If the user clicked on a shortcut, read in the key code that it was + * converted into. Else the click has been handled or was invalid. */ if (do_mouse() == 1) - /* The click was on a shortcut -- read in the character - * that it was converted into. */ input = get_kbinput(edit, BLIND); else - /* The click was invalid or has been handled -- get out. */ return; } #endif @@ -2587,6 +2583,6 @@ int main(int argc, char **argv) put_cursor_at_end_of_answer(); /* Read in and interpret a single keystroke. */ - do_input(); + process_a_keystroke(); } }