comparison src/testdir/test_vim9_script.vim @ 27966:80f398bfc19f v8.2.4508

patch 8.2.4508: Vim9: cannot assign to a global variable on the command line Commit: https://github.com/vim/vim/commit/330a388e18ad6b64c3574c712db675258b0e9878 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 5 11:05:57 2022 +0000 patch 8.2.4508: Vim9: cannot assign to a global variable on the command line Problem: Vim9: cannot assign to a global variable on the command line. Solution: Allow using :vim9cmd for assignment on the command line.
author Bram Moolenaar <Bram@vim.org>
date Sat, 05 Mar 2022 12:15:04 +0100
parents 2485bf68de34
children 212c5894b8b1
comparison
equal deleted inserted replaced
27965:735bd3823bb5 27966:80f398bfc19f
3363 endfunc 3363 endfunc
3364 3364
3365 def Run_test_reject_declaration() 3365 def Run_test_reject_declaration()
3366 var buf = g:RunVimInTerminal('', {'rows': 6}) 3366 var buf = g:RunVimInTerminal('', {'rows': 6})
3367 term_sendkeys(buf, ":vim9cmd var x: number\<CR>") 3367 term_sendkeys(buf, ":vim9cmd var x: number\<CR>")
3368 g:VerifyScreenDump(buf, 'Test_vim9_reject_declaration', {}) 3368 g:VerifyScreenDump(buf, 'Test_vim9_reject_declaration_1', {})
3369 term_sendkeys(buf, ":\<CR>")
3370 term_sendkeys(buf, ":vim9cmd g:foo = 123 | echo g:foo\<CR>")
3371 g:VerifyScreenDump(buf, 'Test_vim9_reject_declaration_2', {})
3369 3372
3370 # clean up 3373 # clean up
3371 g:StopVimInTerminal(buf) 3374 g:StopVimInTerminal(buf)
3372 enddef 3375 enddef
3373 3376