vim-patch:8.2.0602: :unlet $VAR does not work properly (#13238)

Problem:    :unlet $VAR does not work properly.
Solution:   Make ":lockvar $VAR" fail.  Check the "skip" flag.
7e0868efcf

Include patch 8.2.0601 changes so that ex_unletlock() can execute a callback if there are no errors.
This commit is contained in:
Sean Dewar
2020-12-02 13:44:13 +00:00
committed by GitHub
parent d80f262f89
commit 8fb786e415
3 changed files with 96 additions and 55 deletions

View File

@@ -1393,6 +1393,20 @@ func Test_compound_assignment_operators()
let @/ = ''
endfunc
func Test_unlet_env()
let $TESTVAR = 'yes'
call assert_equal('yes', $TESTVAR)
call assert_fails('lockvar $TESTVAR', 'E940')
call assert_fails('unlockvar $TESTVAR', 'E940')
call assert_equal('yes', $TESTVAR)
if 0
unlet $TESTVAR
endif
call assert_equal('yes', $TESTVAR)
unlet $TESTVAR
call assert_equal('', $TESTVAR)
endfunc
func Test_funccall_garbage_collect()
func Func(x, ...)
call add(a:x, a:000)