File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3039,6 +3039,42 @@ def Test_source_vim9_from_legacy()
30393039 delete (' Xvim9_script.vim' )
30403040enddef
30413041
3042+ func Test_vim9script_not_global ()
3043+ " check that items defined in Vim9 script are script-local, not global
3044+ let vim9lines = << trim END
3045+ vim9script
3046+ let var = ' local'
3047+ func TheFunc ()
3048+ echo ' local'
3049+ endfunc
3050+ def DefFunc ()
3051+ echo ' local'
3052+ enddef
3053+ END
3054+ call writefile (vim9lines, ' Xvim9script.vim' )
3055+ source Xvim9script.vim
3056+ try
3057+ echo g: var
3058+ assert_report (' did not fail' )
3059+ catch /E121:/
3060+ " caught
3061+ endtry
3062+ try
3063+ call TheFunc ()
3064+ assert_report (' did not fail' )
3065+ catch /E117:/
3066+ " caught
3067+ endtry
3068+ try
3069+ call DefFunc ()
3070+ assert_report (' did not fail' )
3071+ catch /E117:/
3072+ " caught
3073+ endtry
3074+
3075+ call delete (' Xvim9script.vium' )
3076+ endfunc
3077+
30423078def Test_vim9_copen ()
30433079 # this was giving an error for setting w: quickfix_title
30443080 copen
Original file line number Diff line number Diff line change @@ -754,6 +754,8 @@ static char *(features[]) =
754754
755755static int included_patches [] =
756756{ /* Add new patch number below this line */
757+ /**/
758+ 1450 ,
757759/**/
758760 1449 ,
759761/**/
You can’t perform that action at this time.
0 commit comments