Skip to content

Commit 8c8772c

Browse files
zeertzjqchrisbra
authored andcommitted
patch 9.2.0277: tests: test_modeline.vim fails
Problem: tests: test_modeline.vim fails (after v9.2.0276) Solution: Rewrite the tests to use the existing s:modeline_fails() function, update documentation (zeertzjq). Signed-off-by: zeertzjq <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 52169db commit 8c8772c

3 files changed

Lines changed: 11 additions & 26 deletions

File tree

runtime/doc/options.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*options.txt* For Vim version 9.2. Last change: 2026 Mar 29
1+
*options.txt* For Vim version 9.2. Last change: 2026 Apr 01
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2226,6 +2226,8 @@ A jump table for the options with a short description can be found at |Q_op|.
22262226
Note: The match limit takes effect only during forward completion
22272227
(CTRL-N) and is ignored during backward completion (CTRL-P).
22282228

2229+
This option cannot be set in a modeline when 'modelineexpr' is off.
2230+
22292231
*'completefunc'* *'cfu'*
22302232
'completefunc' 'cfu' string (default: empty)
22312233
local to buffer
@@ -4686,6 +4688,7 @@ A jump table for the options with a short description can be found at |Q_op|.
46864688
You can include a line break. Simplest method is to use |:let|: >
46874689
:let &guitabtooltip = "line one\nline two"
46884690
<
4691+
This option cannot be set in a modeline when 'modelineexpr' is off.
46894692

46904693
*'helpfile'* *'hf'*
46914694
'helpfile' 'hf' string (default (MS-Windows) "$VIMRUNTIME\doc\help.txt"
@@ -6847,6 +6850,8 @@ A jump table for the options with a short description can be found at |Q_op|.
68476850
The format of the header produced in |:hardcopy| output.
68486851
See |pheader-option|.
68496852

6853+
This option cannot be set in a modeline when 'modelineexpr' is off.
6854+
68506855
*'printmbcharset'* *'pmbcs'*
68516856
'printmbcharset' 'pmbcs' string (default "")
68526857
global

src/testdir/test_modeline.vim

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,16 @@ endfunc
261261

262262
func Test_modeline_fails_modelineexpr()
263263
call s:modeline_fails('balloonexpr', 'balloonexpr=Something()', 'E992:')
264+
call s:modeline_fails('complete', "complete=FSomething", 'E992:')
264265
call s:modeline_fails('foldexpr', 'foldexpr=Something()', 'E992:')
265266
call s:modeline_fails('foldtext', 'foldtext=Something()', 'E992:')
266267
call s:modeline_fails('formatexpr', 'formatexpr=Something()', 'E992:')
267268
call s:modeline_fails('guitablabel', 'guitablabel=Something()', 'E992:')
269+
call s:modeline_fails('guitabtooltip', 'guitabtooltip=Something()', 'E992:')
268270
call s:modeline_fails('iconstring', 'iconstring=Something()', 'E992:')
269271
call s:modeline_fails('includeexpr', 'includeexpr=Something()', 'E992:')
270272
call s:modeline_fails('indentexpr', 'indentexpr=Something()', 'E992:')
273+
call s:modeline_fails('printheader', 'printheader=Something()', 'E992:')
271274
call s:modeline_fails('rulerformat', 'rulerformat=Something()', 'E992:')
272275
call s:modeline_fails('statusline', 'statusline=Something()', 'E992:')
273276
call s:modeline_fails('tabline', 'tabline=Something()', 'E992:')
@@ -490,29 +493,4 @@ func Test_modeline_nowrap_lcs_extends()
490493
set equalalways&
491494
endfunc
492495

493-
func Test_modeline_forbidden()
494-
let tempfile = tempname()
495-
let lines =<< trim END
496-
some test text for completion
497-
vim: set complete=F{->system('touch_should_not_run')} :
498-
END
499-
call writefile(lines, tempfile, 'D')
500-
call assert_fails($'new {tempfile}', 'E992:')
501-
bw!
502-
let lines =<< trim END
503-
some text
504-
vim: set guitabtooltip=%{%mapset()%}:
505-
END
506-
call writefile(lines, tempfile)
507-
call assert_fails($'new {tempfile}', 'E992:')
508-
bw!
509-
let lines =<< trim END
510-
some text
511-
vim: set printheader=%{mapset('n',0,{})%)%}:
512-
END
513-
call writefile(lines, tempfile, 'D')
514-
call assert_fails($'new {tempfile}', 'E992:')
515-
bw!
516-
endfunc
517-
518496
" vim: shiftwidth=2 sts=2 expandtab

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ static char *(features[]) =
734734

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
277,
737739
/**/
738740
276,
739741
/**/

0 commit comments

Comments
 (0)