forked from aniani/vim
patch 8.2.3228: cannot use a simple block for the :command argument
Problem: Cannot use a simple block for the :command argument. (Maarten Tournoij) Solution: Recognize a simple {} block. (issue #8623)
This commit is contained in:
@@ -622,4 +622,22 @@ func Test_usercmd_custom()
|
||||
delfunc T2
|
||||
endfunc
|
||||
|
||||
func Test_usercmd_with_block()
|
||||
command DoSomething {
|
||||
g:didit = 'yes'
|
||||
g:didmore = 'more'
|
||||
}
|
||||
DoSomething
|
||||
call assert_equal('yes', g:didit)
|
||||
call assert_equal('more', g:didmore)
|
||||
unlet g:didit
|
||||
unlet g:didmore
|
||||
|
||||
let lines =<< trim END
|
||||
command DoesNotEnd {
|
||||
echo 'hello'
|
||||
END
|
||||
call CheckScriptFailure(lines, 'E1026:')
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
Reference in New Issue
Block a user