patch 9.2.0465: modeline: foldmarker cannot be set with modelinestrict
Commit:
https://github.com/vim/vim/commit/2020e0bade4b1123460d1e1255ac41aa06577943
Author: Christian Brabandt <[email protected]>
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 <[email protected]>
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,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1wM7k8-00Fg11-0E%40256bit.org.