commit 454563c9dc37f935bf68997fffcbb2cd8f3fd0a3
parent 62bb6e85fc1d7bb5dd2ee38db0aa1ac3c975230c
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Fri, 13 Jun 2014 12:07:18 +0000
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
Diffstat:
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,7 @@
+2014-06-13 Benno Schulenberg <bensberg@justemail.net>
+ * src/nano.c (do_input): Repositioning the cursor with the mouse
+ (result == 0) should break a series of ^Ks.
+
2014-06-11 Benno Schulenberg <bensberg@justemail.net>
* 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
@@ -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