From fc9c7b4917011f6ee82e0369e8284f4a965345d8 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Tue, 13 Sep 2016 10:26:08 +0200
Subject: [PATCH] softwrap: scroll when searching lands on an overlong bottom
 line

This fixes https://savannah.gnu.org/bugs/index.php?42189.
---
 src/winio.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/winio.c b/src/winio.c
index 045462d2..1b647562 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -2873,6 +2873,10 @@ void edit_redraw(filestruct *old_current)
 
     /* If the current line is offscreen, scroll until it's onscreen. */
     if (openfile->current->lineno >= openfile->edittop->lineno + maxrows ||
+#ifndef NANO_TINY
+		(openfile->current->lineno == openfile->edittop->lineno + maxrows - 1 &&
+		ISSET(SOFTWRAP) && strlenpt(openfile->current->data) >= COLS) ||
+#endif
 		openfile->current->lineno < openfile->edittop->lineno) {
 	edit_update((focusing || !ISSET(SMOOTH_SCROLL)) ? CENTERING : FLOWING);
 	refresh_needed = TRUE;
-- 
GitLab