Mercurial > vim
changeset 16730:000350f8e4d1 v8.1.1367
patch 8.1.1367: can set 'modelineexpr' in modeline
commit https://github.com/vim/vim/commit/7e800c6047c8a9cc3e5cbc019a4dc91ec36616b1
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu May 23 17:08:49 2019 +0200
patch 8.1.1367: can set 'modelineexpr' in modeline
Problem: can set 'modelineexpr' in modeline.
Solution: Add P_SECURE flag.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 23 May 2019 17:15:06 +0200 |
parents | c775ddbeb6fe |
children | 5ea748e567c3 |
files | src/option.c src/testdir/test_modeline.vim src/version.c |
diffstat | 3 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/option.c +++ b/src/option.c @@ -1889,7 +1889,7 @@ static struct vimoption options[] = {"modeline", "ml", P_BOOL|P_VIM, (char_u *)&p_ml, PV_ML, {(char_u *)FALSE, (char_u *)TRUE} SCTX_INIT}, - {"modelineexpr", "mle", P_BOOL|P_VI_DEF, + {"modelineexpr", "mle", P_BOOL|P_VI_DEF|P_SECURE, (char_u *)&p_mle, PV_NONE, {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"modelines", "mls", P_NUM|P_VI_DEF,
--- a/src/testdir/test_modeline.vim +++ b/src/testdir/test_modeline.vim @@ -119,6 +119,7 @@ func Test_modeline_fails_always() call s:modeline_fails('makespellmem', 'makespellmem=Something()', 'E520:') call s:modeline_fails('mzschemedll', 'mzschemedll=Something()', 'E520:') call s:modeline_fails('mzschemegcdll', 'mzschemegcdll=Something()', 'E520:') + call s:modeline_fails('modelineexpr', 'modelineexpr', 'E520:') call s:modeline_fails('omnifunc', 'omnifunc=Something()', 'E520:') call s:modeline_fails('operatorfunc', 'operatorfunc=Something()', 'E520:') call s:modeline_fails('perldll', 'perldll=Something()', 'E520:')