From f35c3dbd573dfb31922e5b81e370179d056bcf6b Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Thu, 5 Jan 2017 21:40:23 -0600
Subject: [PATCH] softwrap: ensure the current line is fully visible after
 inserting a file

This fixes https://savannah.gnu.org/bugs/?49994.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
---
 src/files.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/files.c b/src/files.c
index e30c47fb..595c63c5 100644
--- a/src/files.c
+++ b/src/files.c
@@ -1282,6 +1282,10 @@ void do_insertfile(void)
 		 * of lines inserted. */
 		reset_cursor();
 
+#ifndef NANO_TINY
+		if (ISSET(SOFTWRAP))
+		    ensure_line_is_visible();
+#endif
 		refresh_needed = TRUE;
 	    }
 
-- 
GitLab