diff --git a/src/global.c b/src/global.c
index d231c017a0b2ccbfff3ac8a128f029dcf4716170..b0e1f8cca61467473f6c63c1bcf1e640cbc2ccdf 100644
--- a/src/global.c
+++ b/src/global.c
@@ -94,8 +94,6 @@ WINDOW *bottomwin;
 	 * messages, the statusbar prompt, and a list of shortcuts. */
 int editwinrows = 0;
 	/* How many rows does the edit window take up? */
-int maxlines = 0;
-	/* How many file lines can be shown (due to soft wrapping). */
 
 filestruct *cutbuffer = NULL;
 	/* The buffer where we store cut text. */
diff --git a/src/proto.h b/src/proto.h
index 87b92a0dcd924a26be72f4f9fc28e99c859c05cf..707e3d56a5918824b25f9c474a7c3eac2bf9f7c9 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -76,7 +76,6 @@ extern WINDOW *topwin;
 extern WINDOW *edit;
 extern WINDOW *bottomwin;
 extern int editwinrows;
-extern int maxlines;
 
 extern filestruct *cutbuffer;
 extern filestruct *cutbottom;
diff --git a/src/winio.c b/src/winio.c
index b4230a548e12081a2f693f3c1b2a90f074b060be..3123a07737e4e3bc3dab657238d670bc10c68fc8 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -2728,32 +2728,6 @@ bool line_needs_update(const size_t old_column, const size_t new_column)
 	return (get_page_start(old_column) != get_page_start(new_column));
 }
 
-/* Determine how many file lines we can display, accounting for softwraps. */
-void compute_maxlines(void)
-{
-#ifndef NANO_TINY
-    if (ISSET(SOFTWRAP)) {
-	filestruct *line = openfile->edittop;
-	int row = 0;
-
-	maxlines = 0;
-
-	while (row < editwinrows && line != NULL) {
-	    row += (strlenpt(line->data) / editwincols) + 1;
-	    line = line->next;
-	    maxlines++;
-	}
-
-	if (row < editwinrows)
-	    maxlines += (editwinrows - row);
-#ifdef DEBUG
-	fprintf(stderr, "recomputed: maxlines = %d\n", maxlines);
-#endif
-    } else
-#endif /* !NANO_TINY */
-	maxlines = editwinrows;
-}
-
 /* Try to move up nrows softwrapped chunks from the given line and the
  * given column (leftedge).  After moving, leftedge will be set to the
  * starting column of the current chunk.  Return the number of chunks we
@@ -2941,8 +2915,6 @@ void edit_scroll(scroll_dir direction, int nrows)
 		openfile->current_x : 0);
 	line = line->next;
     }
-
-    compute_maxlines();
 }
 
 /* Return TRUE if current[current_x] is above the top of the screen, and FALSE
@@ -3028,14 +3000,11 @@ void edit_refresh(void)
     filestruct *line;
     int row = 0;
 
-    /* Figure out what maxlines should really be. */
-    compute_maxlines();
-
     /* If the current line is out of view, get it back on screen. */
     if (current_is_offscreen()) {
 #ifdef DEBUG
-	fprintf(stderr, "edit-refresh: line = %ld, edittop = %ld and maxlines = %d\n",
-		(long)openfile->current->lineno, (long)openfile->edittop->lineno, maxlines);
+	fprintf(stderr, "edit-refresh: line = %ld, edittop = %ld and editwinrows = %d\n",
+		(long)openfile->current->lineno, (long)openfile->edittop->lineno, editwinrows);
 #endif
 	adjust_viewport((focusing || !ISSET(SMOOTH_SCROLL)) ? CENTERING : STATIONARY);
     }
@@ -3110,7 +3079,6 @@ void adjust_viewport(update_type manner)
 #ifdef DEBUG
     fprintf(stderr, "adjust_viewport(): setting edittop to lineno %ld\n", (long)openfile->edittop->lineno);
 #endif
-    compute_maxlines();
 }
 
 /* Unconditionally redraw the entire screen. */