0
0
mirror of https://github.com/vim/vim.git synced 2025-10-18 07:54:29 -04:00

patch 8.1.1188: not all Vim variables require the v: prefix

Problem:    Not all Vim variables require the v: prefix.
Solution:   When scriptversion is 3 all Vim variables can only be used with
            the v: prefix.  (Ken Takata, closes #4274)
This commit is contained in:
Bram Moolenaar
2019-04-20 14:39:52 +02:00
parent 3a4c53ba51
commit d2e716e6df
5 changed files with 36 additions and 10 deletions

View File

@@ -154,6 +154,22 @@ func Test_string_concat_scriptversion1()
endif
endfunc
scriptversion 3
func Test_vvar_scriptversion3()
call assert_fails('echo version', 'E121:')
call assert_false(exists('version'))
let version = 1
call assert_equal(1, version)
endfunc
scriptversion 2
func Test_vvar_scriptversion2()
call assert_true(exists('version'))
echo version
call assert_fails('let version = 1', 'E46:')
call assert_equal(v:version, version)
endfunc
func Test_scriptversion()
call writefile(['scriptversion 9'], 'Xversionscript')
call assert_fails('source Xversionscript', 'E999:')