summaryrefslogtreecommitdiff
path: root/src/fold.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-04-13 20:52:36 +0200
committerBram Moolenaar <Bram@vim.org>2015-04-13 20:52:36 +0200
commit05b20fb14ec3219d73014595cfb6cc28ae1e1fc3 (patch)
tree82f3665897738a2ee2a91681dff9c4919801f3e1 /src/fold.c
parent9bc174b69d2775b0f27ed74bf372608d18c9f3d4 (diff)
downloadvim-git-05b20fb14ec3219d73014595cfb6cc28ae1e1fc3.tar.gz
patch 7.4.699v7.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)
Diffstat (limited to 'src/fold.c')
-rw-r--r--src/fold.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/fold.c b/src/fold.c
index 41fcee0fd..671bbf75a 100644
--- a/src/fold.c
+++ b/src/fold.c
@@ -234,6 +234,8 @@ hasFoldingWin(win, lnum, firstp, lastp, cache, infop)
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)