diff options
author | Hu Jialun <hujialun@comp.nus.edu.sg> | 2021-08-28 20:42:50 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-08-28 20:42:50 +0200 |
commit | 9dcd349ca85e1df1abd1cbf1c29c0f1574b70bf8 (patch) | |
tree | a3b5f55b7ab7d58e173349c318906c77583f7691 /src/buffer.c | |
parent | 9aecf79c45da5593e4d8c0de1b2d212edc4765ce (diff) | |
download | vim-git-9dcd349ca85e1df1abd1cbf1c29c0f1574b70bf8.tar.gz |
patch 8.2.3384: cannot disable modeline for an individual filev8.2.3384
Problem: Cannot disable modeline for an individual file.
Solution: Recognize "nomodeline" in a modeline. (Hu Jialun, closes #8798)
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 4 |
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; |