vim/SOURCES/0001-patch-9.2.0277-tests-test_modeline.vim-fails.patch
2026-04-29 05:37:10 -04:00

80 lines
3.4 KiB
Diff

diff -up vim82/runtime/doc/options.txt.modeline-tests vim82/runtime/doc/options.txt
--- vim82/runtime/doc/options.txt.modeline-tests 2021-03-22 10:02:41.000000000 +0100
+++ vim82/runtime/doc/options.txt 2026-04-08 15:37:50.007970018 +0200
@@ -1879,6 +1879,8 @@ A jump table for the options with a shor
based expansion (e.g., dictionary |i_CTRL-X_CTRL-K|, included patterns
|i_CTRL-X_CTRL-I|, tags |i_CTRL-X_CTRL-]| and normal expansions).
+ This option cannot be set in a modeline when 'modelineexpr' is off.
+
*'completefunc'* *'cfu'*
'completefunc' 'cfu' string (default: empty)
local to buffer
@@ -3908,6 +3910,7 @@ A jump table for the options with a shor
You can include a line break. Simplest method is to use |:let|: >
:let &guitabtooltip = "line one\nline two"
<
+ This option cannot be set in a modeline when 'modelineexpr' is off.
*'helpfile'* *'hf'*
'helpfile' 'hf' string (default (MS-Windows) "$VIMRUNTIME\doc\help.txt"
@@ -5812,6 +5815,8 @@ A jump table for the options with a shor
The format of the header produced in |:hardcopy| output.
See |pheader-option|.
+ This option cannot be set in a modeline when 'modelineexpr' is off.
+
*'printmbcharset'* *'pmbcs'*
'printmbcharset' 'pmbcs' string (default "")
global
diff -up vim82/src/testdir/test_modeline.vim.modeline-tests vim82/src/testdir/test_modeline.vim
--- vim82/src/testdir/test_modeline.vim.modeline-tests 2026-04-08 15:38:55.992439182 +0200
+++ vim82/src/testdir/test_modeline.vim 2026-04-08 15:40:41.319595292 +0200
@@ -265,13 +265,16 @@ endfunc
func Test_modeline_fails_modelineexpr()
call s:modeline_fails('balloonexpr', 'balloonexpr=Something()', 'E992:')
+ call s:modeline_fails('complete', "complete=FSomething", 'E992:')
call s:modeline_fails('foldexpr', 'foldexpr=Something()', 'E992:')
call s:modeline_fails('foldtext', 'foldtext=Something()', 'E992:')
call s:modeline_fails('formatexpr', 'formatexpr=Something()', 'E992:')
call s:modeline_fails('guitablabel', 'guitablabel=Something()', 'E992:')
+ call s:modeline_fails('guitabtooltip', 'guitabtooltip=Something()', 'E992:')
call s:modeline_fails('iconstring', 'iconstring=Something()', 'E992:')
call s:modeline_fails('includeexpr', 'includeexpr=Something()', 'E992:')
call s:modeline_fails('indentexpr', 'indentexpr=Something()', 'E992:')
+ call s:modeline_fails('printheader', 'printheader=Something()', 'E992:')
call s:modeline_fails('rulerformat', 'rulerformat=Something()', 'E992:')
call s:modeline_fails('statusline', 'statusline=Something()', 'E992:')
call s:modeline_fails('tabline', 'tabline=Something()', 'E992:')
@@ -334,29 +337,4 @@ func Test_modeline_setoption_verbose()
call delete('Xmodeline')
endfunc
-func Test_modeline_forbidden()
- let tempfile = tempname()
- let lines =<< trim END
- some test text for completion
- vim: set complete=F{->system('touch_should_not_run')} :
- END
- call writefile(lines, tempfile, 'D')
- call assert_fails($'new {tempfile}', 'E992:')
- bw!
- let lines =<< trim END
- some text
- vim: set guitabtooltip=%{%mapset()%}:
- END
- call writefile(lines, tempfile)
- call assert_fails($'new {tempfile}', 'E992:')
- bw!
- let lines =<< trim END
- some text
- vim: set printheader=%{mapset('n',0,{})%)%}:
- END
- call writefile(lines, tempfile, 'D')
- call assert_fails($'new {tempfile}', 'E992:')
- bw!
-endfunc
-
" vim: shiftwidth=2 sts=2 expandtab