diff --git a/src/search.c b/src/search.c
index cf7a19ef5160851ea6243c296e3c980997105568..02382b99c7bd65c488fe62d5f1519727a43e24ca 100644
--- a/src/search.c
+++ b/src/search.c
@@ -840,10 +840,11 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
 
 #ifndef NANO_TINY
 		if (ISSET(SOFTWRAP)) {
+			filestruct *currentline = openfile->current;
 			size_t leftedge = leftedge_for(xplustabs(), openfile->current);
 
 			rows_from_tail = (editwinrows / 2) - go_forward_chunks(
-							editwinrows / 2, &openfile->current, &leftedge);
+								editwinrows / 2, &currentline, &leftedge);
 		} else
 #endif
 			rows_from_tail = openfile->filebot->lineno -