Mercurial > vim
comparison src/testdir/test_usercommands.vim @ 9667:c27052511998 v7.4.2110
commit https://github.com/vim/vim/commit/eac784eced501c54d2c99e18a1af96cd996f3a6c
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jul 28 22:08:24 2016 +0200
patch 7.4.2110
Problem: When there is an CmdUndefined autocmd then the error for a missing
command is E464 instead of E492. (Manuel Ortega)
Solution: Don't let the pointer be NULL.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 28 Jul 2016 22:15:06 +0200 |
parents | f7fb117883ba |
children | 1f33aece8e55 |
comparison
equal
deleted
inserted
replaced
9666:d190f1077a34 | 9667:c27052511998 |
---|---|
44 | 44 |
45 delcommand MyCmd | 45 delcommand MyCmd |
46 delcommand MyQCmd | 46 delcommand MyQCmd |
47 unlet g:mods | 47 unlet g:mods |
48 endfunction | 48 endfunction |
49 | |
50 func Test_Ambiguous() | |
51 command Doit let g:didit = 'yes' | |
52 command Dothat let g:didthat = 'also' | |
53 call assert_fails('Do', 'E464:') | |
54 Doit | |
55 call assert_equal('yes', g:didit) | |
56 Dothat | |
57 call assert_equal('also', g:didthat) | |
58 unlet g:didit | |
59 unlet g:didthat | |
60 | |
61 delcommand Doit | |
62 Do | |
63 call assert_equal('also', g:didthat) | |
64 delcommand Dothat | |
65 endfunc | |
66 | |
67 func Test_CmdUndefined() | |
68 call assert_fails('Doit', 'E492:') | |
69 au CmdUndefined Doit :command Doit let g:didit = 'yes' | |
70 Doit | |
71 call assert_equal('yes', g:didit) | |
72 delcommand Doit | |
73 | |
74 call assert_fails('Dothat', 'E492:') | |
75 au CmdUndefined * let g:didnot = 'yes' | |
76 call assert_fails('Dothat', 'E492:') | |
77 call assert_equal('yes', g:didnot) | |
78 endfunc |