pasting: restore the cap on the number of chunks to move backward

This fixes https://savannah.gnu.org/bugs/?51514.
master
Benno Schulenberg 2017-07-20 09:41:27 +02:00
parent 0e4cbd4bfd
commit a1fba43452
1 changed files with 4 additions and 0 deletions

View File

@ -2803,6 +2803,10 @@ int go_back_chunks(int nrows, filestruct **line, size_t *leftedge)
{ {
int i; 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 #ifndef NANO_TINY
if (ISSET(SOFTWRAP)) { if (ISSET(SOFTWRAP)) {
/* Recede through the requested number of chunks. */ /* Recede through the requested number of chunks. */