Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
25381:d5abf60e9872 | 25382:b80e4e9c4988 |
---|---|
620 call assert_equal('"TCmd2 ', @:) | 620 call assert_equal('"TCmd2 ', @:) |
621 delcommand TCmd2 | 621 delcommand TCmd2 |
622 delfunc T2 | 622 delfunc T2 |
623 endfunc | 623 endfunc |
624 | 624 |
625 func Test_usercmd_with_block() | |
626 command DoSomething { | |
627 g:didit = 'yes' | |
628 g:didmore = 'more' | |
629 } | |
630 DoSomething | |
631 call assert_equal('yes', g:didit) | |
632 call assert_equal('more', g:didmore) | |
633 unlet g:didit | |
634 unlet g:didmore | |
635 | |
636 let lines =<< trim END | |
637 command DoesNotEnd { | |
638 echo 'hello' | |
639 END | |
640 call CheckScriptFailure(lines, 'E1026:') | |
641 endfunc | |
642 | |
625 " vim: shiftwidth=2 sts=2 expandtab | 643 " vim: shiftwidth=2 sts=2 expandtab |