diff src/fold.c @ 6753:c1aa837853ea v7.4.699

patch 7.4.699 Problem: E315 when trying to delete a fold. (Yutao Yuan) Solution: Make sure the fold doesn't go beyond the last buffer line. (Christian Brabandt)
author Bram Moolenaar <bram@vim.org>
date Mon, 13 Apr 2015 20:52:36 +0200
parents 50dbef5e774a
children b85fcd9b858d
line wrap: on
line diff
--- a/src/fold.c
+++ b/src/fold.c
@@ -234,6 +234,8 @@ hasFoldingWin(win, lnum, firstp, lastp, 
 	return FALSE;
     }
 
+    if (last > win->w_buffer->b_ml.ml_line_count)
+	last = win->w_buffer->b_ml.ml_line_count;
     if (lastp != NULL)
 	*lastp = last;
     if (firstp != NULL)