diff src/testdir/test_usercommands.vim @ 25382:b80e4e9c4988 v8.2.3228

patch 8.2.3228: cannot use a simple block for the :command argument Commit: https://github.com/vim/vim/commit/5d7c2df536c17db4a9c61e0760bdcf78d0db7330 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jul 27 21:17:32 2021 +0200 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)
author Bram Moolenaar <Bram@vim.org>
date Tue, 27 Jul 2021 21:30:08 +0200
parents a9ea83a3659a
children 8ecd3575bc8c
line wrap: on
line diff
--- a/src/testdir/test_usercommands.vim
+++ b/src/testdir/test_usercommands.vim
@@ -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