Index: src/cut.c =================================================================== --- src/cut.c (revision 5620) +++ src/cut.c (working copy) @@ -238,6 +238,11 @@ static struct filestruct *next_contiguous_line = NULL; bool mark_set = openfile->mark_set; + /* Remember the current view port and cursor position. */ + ssize_t is_edittop_lineno = openfile->edittop->lineno; + ssize_t is_current_lineno = openfile->current->lineno; + size_t is_current_x = openfile->current_x; + if (mark_set || openfile->current != next_contiguous_line) cutbuffer_reset(); @@ -245,6 +250,11 @@ /* If the mark was set, blow away the cutbuffer on the next copy. */ next_contiguous_line = (mark_set ? NULL : openfile->current); + + /* Restore the view port and cursor position. */ + openfile->edittop = fsfromline(is_edittop_lineno); + openfile->current = fsfromline(is_current_lineno); + openfile->current_x = is_current_x; } /* Cut from the current cursor position to the end of the file. */