diff options
-rw-r--r-- | runtime/doc/syntax.txt | 3 | ||||
-rw-r--r-- | test/old/testdir/gen_opt_test.vim | 12 | ||||
-rw-r--r-- | test/old/testdir/test_getvar.vim | 11 |
3 files changed, 20 insertions, 6 deletions
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 3cb96226da..c032a8c20d 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -5472,7 +5472,8 @@ This will set the "w:current_syntax" variable to "foo". The value of restoring "b:current_syntax", since the syntax files do set "b:current_syntax". The value set by the syntax file is assigned to "w:current_syntax". -Note: This resets the 'spell', 'spellcapcheck' and 'spellfile' options. +Note: This resets the 'spell', 'spellcapcheck', 'spellfile' and 'spelloptions' +options. Once a window has its own syntax, syntax commands executed from other windows on the same buffer (including :syntax clear) have no effect. Conversely, diff --git a/test/old/testdir/gen_opt_test.vim b/test/old/testdir/gen_opt_test.vim index f64798f8dd..325e7e9438 100644 --- a/test/old/testdir/gen_opt_test.vim +++ b/test/old/testdir/gen_opt_test.vim @@ -25,7 +25,7 @@ endwhile call extend(global_locals, #{ \ scrolloff: -1, \ sidescrolloff: -1, - \ undolevels: -12345, + \ undolevels: -123456, \}) " Get local-noglobal options. @@ -63,7 +63,8 @@ let skip_setglobal_reasons = #{ \ winhighlight: 'TODO(nvim): fix missing error handling for setglobal', \} -" The terminal size is restored at the end. +" Script header. +" The test values contains multibyte characters. let script = [ \ '" DO NOT EDIT: Generated with gen_opt_test.vim', \ '" Used by test_options_all.vim.', @@ -453,8 +454,9 @@ for option in options endfor " Testing to clear the local value and switch back to the global value. if global_locals->has_key(fullname) - let swichback_val = global_locals[fullname] - call add(script, $'setlocal {opt}={swichback_val}') + let switchback_val = global_locals[fullname] + call add(script, $'setlocal {opt}={switchback_val}') + call add(script, $'call assert_equal(&g:{fullname}, &{fullname})') endif endfor @@ -516,4 +518,4 @@ endif qa! -" vim:sw=2:ts=8:noet:nolist:nosta: +" vim:sw=2:ts=8:noet:nosta: diff --git a/test/old/testdir/test_getvar.vim b/test/old/testdir/test_getvar.vim index 56f737ab9c..de00281ba3 100644 --- a/test/old/testdir/test_getvar.vim +++ b/test/old/testdir/test_getvar.vim @@ -22,6 +22,12 @@ func Test_var() call assert_equal('Chance', getwinvar(9, '', def_str)) call assert_equal(0, getwinvar(1, '&nu')) call assert_equal(0, getwinvar(1, '&nu', 1)) + call assert_match(v:t_dict, type(getwinvar(1, '&'))) + call assert_match(v:t_dict, type(getwinvar(1, '&', def_str))) + call assert_equal('', getwinvar(9, '&')) + call assert_equal('Chance', getwinvar(9, '&', def_str)) + call assert_equal('', getwinvar(1, '&nux')) + call assert_equal('Chance', getwinvar(1, '&nux', def_str)) unlet def_str " test for gettabvar() @@ -83,7 +89,12 @@ func Test_var() unlet def_dict + call assert_match(v:t_dict, type(gettabwinvar(2, 3, '&'))) + call assert_match(v:t_dict, type(gettabwinvar(2, 3, '&', 1))) call assert_equal("", gettabwinvar(9, 2020, '')) + call assert_equal(1, gettabwinvar(9, 2020, '', 1)) + call assert_equal('', gettabwinvar(9, 2020, '&')) + call assert_equal(1, gettabwinvar(9, 2020, '&', 1)) call assert_equal('', gettabwinvar(2, 3, '&nux')) call assert_equal(1, gettabwinvar(2, 3, '&nux', 1)) tabonly |