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