nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit a1fba434520be4320cfe76d0a62fb3bd42658e2d
parent 0e4cbd4bfd2c40c99710f894f5f3d5a4cfe1b816
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu, 20 Jul 2017 09:41:27 +0200

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

This fixes https://savannah.gnu.org/bugs/?51514.

Diffstat:
Msrc/winio.c | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/winio.c b/src/winio.c @@ -2803,6 +2803,10 @@ 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. */