summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buffer.c b/src/buffer.c
index bc3378a99..507eb0126 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5446,12 +5446,12 @@ do_modelines(int flags)
return;
++entered;
- for (lnum = 1; lnum <= curbuf->b_ml.ml_line_count && lnum <= nmlines;
+ for (lnum = 1; curbuf->b_p_ml && lnum <= curbuf->b_ml.ml_line_count && lnum <= nmlines;
++lnum)
if (chk_modeline(lnum, flags) == FAIL)
nmlines = 0;
- for (lnum = curbuf->b_ml.ml_line_count; lnum > 0 && lnum > nmlines
+ for (lnum = curbuf->b_ml.ml_line_count; curbuf->b_p_ml && lnum > 0 && lnum > nmlines
&& lnum > curbuf->b_ml.ml_line_count - nmlines; --lnum)
if (chk_modeline(lnum, flags) == FAIL)
nmlines = 0;