Commit: patch 9.2.0465: modeline: foldmarker cannot be set with modelinestrict

4 views
Skip to first unread message

Christian Brabandt

unread,
May 10, 2026, 1:15:12 PM (10 days ago) May 10
to vim...@googlegroups.com
patch 9.2.0465: modeline: foldmarker cannot be set with modelinestrict

Commit: https://github.com/vim/vim/commit/2020e0bade4b1123460d1e1255ac41aa06577943
Author: Christian Brabandt <c...@256bit.org>
Date: Sun May 10 17:00:59 2026 +0000

patch 9.2.0465: modeline: foldmarker cannot be set with modelinestrict

Problem: modeline: foldmarker cannot be set with modelinestrict
(Lyderic Landry, after v9.2.0350)
Solution: Add foldmarker option to the whitelist

fixes: #20028
closes: #20174

Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index c3753f197..99e4e70a3 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 9.2. Last change: 2026 May 08
+*options.txt* For Vim version 9.2. Last change: 2026 May 10


VIM REFERENCE MANUAL by Bram Moolenaar
@@ -6216,6 +6216,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'filetype'
'foldcolumn'
'foldenable'
+ 'foldmarker'
'foldmethod'
'modifiable'
'readonly'
diff --git a/src/option.c b/src/option.c
index 4197d4d8b..31f84c98d 100644
--- a/src/option.c
+++ b/src/option.c
@@ -1554,6 +1554,7 @@ static char *modeline_whitelist[] =
"filetype",
"foldcolumn",
"foldenable",
+ "foldmarker",
"foldmethod",
"modifiable",
"readonly",
diff --git a/src/testdir/test_modeline.vim b/src/testdir/test_modeline.vim
index 6884ab473..cb489ee15 100644
--- a/src/testdir/test_modeline.vim
+++ b/src/testdir/test_modeline.vim
@@ -563,11 +563,12 @@ func Test_modeline_strict_allowed()
set modeline modelinestrict

" Whitelisted options should work
- call writefile(['vim: set ts=2 sw=4 et :'], 'Xmodeline_strict', 'D')
+ call writefile(['vim: set ts=2 sw=4 et foldmarker=[,]:'], 'Xmodeline_strict', 'D')
split Xmodeline_strict
call assert_equal(2, &ts)
call assert_equal(4, &sw)
call assert_equal(1, &et)
+ call assert_equal('[,]', &foldmarker)
bwipe!

" 'filetype' should work
diff --git a/src/version.c b/src/version.c
index 339bc4459..102a0d4eb 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 465,
/**/
464,
/**/
Reply all
Reply to author
Forward
0 new messages