]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0465: modeline: foldmarker cannot be set with modelinestrict v9.2.0465
authorChristian Brabandt <cb@256bit.org>
Sun, 10 May 2026 17:00:59 +0000 (17:00 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 10 May 2026 17:00:59 +0000 (17:00 +0000)
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 <cb@256bit.org>
runtime/doc/options.txt
src/option.c
src/testdir/test_modeline.vim
src/version.c

index c3753f197fcda011aec8801ebfa9412013080f82..99e4e70a3a94896634c1608b0b2f291394795e8d 100644 (file)
@@ -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'
index 4197d4d8b7958b955702f0a3ccfac1eebb813d9d..31f84c98d1ac5d789abe4d396ee4b28482491241 100644 (file)
@@ -1554,6 +1554,7 @@ static char *modeline_whitelist[] =
     "filetype",
     "foldcolumn",
     "foldenable",
+    "foldmarker",
     "foldmethod",
     "modifiable",
     "readonly",
index 6884ab473d7d2d5c5666905606c798ec080a41d8..cb489ee15fd9aa10b4d266ae986e98819de8b720 100644 (file)
@@ -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
index 339bc4459361b44ebf3ef8a108db5dd4c80cbde8..102a0d4eb48905208ad2a4b99388961f6f8e065a 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    465,
 /**/
     464,
 /**/