(result == 0) should break a series of ^Ks.
* src/nano.c (do_mouse): Clicking on the titlebar or the statusbar
should not break a series of ^Ks, thus result must not be zero.
+ * src/nano.c (do_input): A toggle should not break a series of ^Ks.
2014-06-11 Benno Schulenberg <bensberg@justemail.net>
* src/winio.c (get_mouseinput): Produce the correct return value for
/* The input buffer. */
static size_t kbinput_len = 0;
/* The length of the input buffer. */
- bool cut_copy = FALSE;
- /* Are we cutting or copying text? */
+ bool preserve = FALSE;
+ /* Preserve the contents of the cutbuffer? */
const sc *s;
bool have_shortcut;
|| s->scfunc == do_copy_text || s->scfunc == do_cut_till_end
#endif
)
- cut_copy = TRUE;
+ preserve = TRUE;
if (s->scfunc != 0) {
const subnfunc *f = sctofunc((sc *) s);
print_view_warning();
else {
#ifndef NANO_TINY
- if (s->scfunc == do_toggle_void)
+ if (s->scfunc == do_toggle_void) {
do_toggle(s->toggle);
- else
+ preserve = TRUE;
+ } else
#endif
{
/* Execute the function of the shortcut. */
}
}
- /* If we aren't cutting or copying text, blow away the text in the
- * cutbuffer upon the next cutting action. */
- if (!cut_copy)
+ /* If we aren't cutting or copying text, and the key wasn't a toggle,
+ * blow away the text in the cutbuffer upon the next cutting action. */
+ if (!preserve)
cutbuffer_reset();
return input;