diff --git a/src/cut.c b/src/cut.c index 43f87e2f..b1b3fb58 100644 --- a/src/cut.c +++ b/src/cut.c @@ -291,8 +291,8 @@ void do_uncut_text(void) /* Mark the file as modified. */ set_modified(); - /* Update current_y to account for the inserted lines. */ - place_the_cursor(TRUE); + /* Set the target row for the cursor in case it got pushed offscreen. */ + openfile->current_y = editwinrows - 1; refresh_needed = TRUE; diff --git a/src/files.c b/src/files.c index bac0e1bf..d2a97182 100644 --- a/src/files.c +++ b/src/files.c @@ -1188,8 +1188,8 @@ void do_insertfile(void) openfile->current_x != was_current_x) set_modified(); - /* Update current_y to account for inserted lines. */ - place_the_cursor(TRUE); + /* Set the target row for the cursor when pushed offscreen. */ + openfile->current_y = editwinrows - 1; refresh_needed = TRUE; } diff --git a/src/winio.c b/src/winio.c index eaf528cd..dce6b252 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2803,10 +2803,6 @@ int go_back_chunks(int nrows, filestruct **line, size_t *leftedge) { int i; - /* Don't move more chunks than the window can hold. */ - if (nrows > editwinrows - 1) - nrows = (editwinrows < 2) ? 1 : editwinrows - 1; - #ifndef NANO_TINY if (ISSET(SOFTWRAP)) { /* Recede through the requested number of chunks. */