From: Benno Schulenberg Date: Fri, 13 Jun 2014 12:07:18 +0000 (+0000) Subject: Letting a mousal repositioning of the cursor break a series of ^Ks. X-Git-Tag: v2.3.5~100 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=454563c9dc37f935bf68997fffcbb2cd8f3fd0a3;p=nano.git Letting a mousal repositioning of the cursor break a series of ^Ks. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4960 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index b5232b0e..aa0faa20 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-06-13 Benno Schulenberg + * src/nano.c (do_input): Repositioning the cursor with the mouse + (result == 0) should break a series of ^Ks. + 2014-06-11 Benno Schulenberg * src/winio.c (get_mouseinput): Produce the correct return value for when a mouse event reinserted something into the keyboard buffer. diff --git a/src/nano.c b/src/nano.c index 4e9ce8b5..7e9b59b0 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1587,11 +1587,15 @@ int do_input(bool *meta_key, bool *func_key, bool allow_funcs) #ifndef DISABLE_MOUSE if (*func_key && input == KEY_MOUSE) { - /* We received a mouse click -- if it was on a shortcut, read in - * the produced shortcut character, otherwise get out. */ - if (do_mouse() == 1) + /* We received a mouse click. */ + int result = do_mouse(); + + if (result == 1) + /* The click was on a shortcut -- read in the character + * that it was converted into. */ input = get_kbinput(edit, meta_key, func_key); - else + else if (result != 0) + /* The click was invalid -- get out. */ return ERR; } #endif