Index: src/nano.c =================================================================== --- src/nano.c (revision 5003) +++ src/nano.c (working copy) @@ -1597,8 +1597,6 @@ /* The input buffer. */ static size_t kbinput_len = 0; /* The length of the input buffer. */ - bool preserve = FALSE; - /* Preserve the contents of the cutbuffer? */ const sc *s; bool have_shortcut; @@ -1689,15 +1687,6 @@ } if (have_shortcut) { - /* If the function associated with this shortcut is - * cutting or copying text, remember this. */ - if (s->scfunc == do_cut_text_void -#ifndef NANO_TINY - || s->scfunc == do_copy_text || s->scfunc == do_cut_till_end -#endif - ) - preserve = TRUE; - if (s->scfunc != 0) { const subnfunc *f = sctofunc((sc *) s); if (ISSET(VIEW_MODE) && f && !f->viewok) @@ -1706,7 +1695,6 @@ #ifndef NANO_TINY if (s->scfunc == do_toggle_void) { do_toggle(s->toggle); - preserve = TRUE; } else #endif { @@ -1730,11 +1718,6 @@ } } - /* 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; } Index: src/text.c =================================================================== --- src/text.c (revision 5003) +++ src/text.c (working copy) @@ -853,9 +853,9 @@ /* Ugh, if we were called while cutting not-to-end, non-marked, and * on the same lineno, we need to abort here. */ u = fs->current_undo; - if (u && u->mark_begin_lineno == fs->current->lineno && + if (u && u->mark_begin_lineno == fs->current->lineno && u->mark_begin_x == fs->current_x && ((current_action == CUT && u->type == CUT && !u->mark_set && keeping_cutbuffer()) || - (current_action == ADD && u->type == ADD && u->mark_begin_x == fs->current_x))) + (current_action == ADD && u->type == ADD))) return; /* Blow away the old undo stack if we are starting from the middle. */