+2014-06-21 Mark Majeres <mark@engine12.com>
+ * src/text.c (undo_cut, add_undo): When undoing a cut-till-eof,
+ put the cursor back where the cut started, and not at the end.
+
2014-06-21 David Lawrence Ramsey <pooka109@gmail.com>
* src/move.c, src/nano.c: Miscellaneous whitespace fixes, one
type fix, and one more #ifdef NANO_TINY.
free_filestruct(cutbuffer);
cutbuffer = NULL;
- if (u->xflags == UNcut_cutline || u->xflags == UNcut_marked_backwards)
+ if (u->xflags == UNcut_cutline || u->xflags == UNcut_marked_backwards || u->type == CUT_EOF)
goto_line_posx(u->mark_begin_lineno, u->mark_begin_x);
}
u->strdata = data;
break;
case CUT_EOF:
+ cutbuffer_reset();
+ break;
case CUT:
cutbuffer_reset();
u->mark_set = openfile->mark_set;
u->mark_begin_lineno = openfile->mark_begin->lineno;
u->mark_begin_x = openfile->mark_begin_x;
}
- else if (!ISSET(CUT_TO_END) && u->type != CUT_EOF) {
+ else if (!ISSET(CUT_TO_END)) {
/* The entire line is being cut regardless of the cursor position. */
u->begin = 0;
u->xflags = UNcut_cutline;