diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-10-13 15:04:34 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-10-13 15:04:34 +0100 |
commit | 7b829268921e8fc1c63c34d245063c1c4e7d21af (patch) | |
tree | a98bfde122c275ec816159fadb69b7280d1dc380 /src/testdir/test_vim9_cmd.vim | |
parent | fff10d9a76099aa9b944f3c33a911127ca1a0c72 (diff) | |
download | vim-git-7b829268921e8fc1c63c34d245063c1c4e7d21af.tar.gz |
patch 8.2.3503: Vim9: using g:pat:cmd is confusingv8.2.3503
Problem: Vim9: using g:pat:cmd is confusing.
Solution: Do not recognize g: as the :global command. Also for s:pat:repl.
(closes #8982)
Diffstat (limited to 'src/testdir/test_vim9_cmd.vim')
-rw-r--r-- | src/testdir/test_vim9_cmd.vim | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim index 93b1295d4..802bae363 100644 --- a/src/testdir/test_vim9_cmd.vim +++ b/src/testdir/test_vim9_cmd.vim @@ -1489,5 +1489,54 @@ def Test_cmdwin_block() au! justTesting enddef +def Test_var_not_cmd() + var lines =<< trim END + g:notexist:cmd + END + CheckDefAndScriptFailure2(lines, 'E488: Trailing characters: :cmd', 'E121: Undefined variable: g:notexist', 1) + + lines =<< trim END + g-pat-cmd + END + CheckDefAndScriptFailure(lines, 'E1241:', 1) + + lines =<< trim END + s:notexist:repl + END + CheckDefAndScriptFailure2(lines, 'E488: Trailing characters: :repl', 'E121: Undefined variable: s:notexist', 1) + + lines =<< trim END + s-pat-repl + END + CheckDefAndScriptFailure(lines, 'E1241:', 1) + + lines =<< trim END + w:notexist->len() + END + CheckDefExecAndScriptFailure(lines, 'E121: Undefined variable: w:notexist', 1) + + lines =<< trim END + b:notexist->len() + END + CheckDefExecAndScriptFailure(lines, 'E121: Undefined variable: b:notexist', 1) + + lines =<< trim END + t:notexist->len() + END + CheckDefExecAndScriptFailure(lines, 'E121: Undefined variable: t:notexist', 1) +enddef + +def Test_no_space_after_command() + var lines =<< trim END + g /pat/cmd + END + CheckDefAndScriptFailure(lines, 'E1242:', 1) + + lines =<< trim END + s /pat/repl + END + CheckDefAndScriptFailure(lines, 'E1242:', 1) +enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker |