From dd8531dbb5042241d20f11ca97436d6d8249c087 Mon Sep 17 00:00:00 2001 From: grtlr Date: Sat, 25 Apr 2015 19:00:25 +0200 Subject: vim-patch:7.4.699 #2508 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) https://code.google.com/p/vim/source/detail?r=v7-4-699 --- src/nvim/fold.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/nvim/fold.c') diff --git a/src/nvim/fold.c b/src/nvim/fold.c index 654cdf82a8..ab557ecf68 100644 --- a/src/nvim/fold.c +++ b/src/nvim/fold.c @@ -241,6 +241,9 @@ hasFoldingWin ( 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) -- cgit