comparison src/testdir/test_vim9_cmd.vim @ 25939:377a7686a52f v8.2.3503

patch 8.2.3503: Vim9: using g:pat:cmd is confusing Commit: https://github.com/vim/vim/commit/7b829268921e8fc1c63c34d245063c1c4e7d21af Author: Bram Moolenaar <Bram@vim.org> Date: Wed Oct 13 15:04:34 2021 +0100 patch 8.2.3503: Vim9: using g:pat:cmd is confusing Problem: Vim9: using g:pat:cmd is confusing. Solution: Do not recognize g: as the :global command. Also for s:pat:repl. (closes #8982)
author Bram Moolenaar <Bram@vim.org>
date Wed, 13 Oct 2021 16:15:04 +0200
parents 8556ded8a462
children 39901825dd61
comparison
equal deleted inserted replaced
25938:26aa27d37199 25939:377a7686a52f
1487 feedkeys("aclose\<CR>", 'xt') 1487 feedkeys("aclose\<CR>", 'xt')
1488 1488
1489 au! justTesting 1489 au! justTesting
1490 enddef 1490 enddef
1491 1491
1492 def Test_var_not_cmd()
1493 var lines =<< trim END
1494 g:notexist:cmd
1495 END
1496 CheckDefAndScriptFailure2(lines, 'E488: Trailing characters: :cmd', 'E121: Undefined variable: g:notexist', 1)
1497
1498 lines =<< trim END
1499 g-pat-cmd
1500 END
1501 CheckDefAndScriptFailure(lines, 'E1241:', 1)
1502
1503 lines =<< trim END
1504 s:notexist:repl
1505 END
1506 CheckDefAndScriptFailure2(lines, 'E488: Trailing characters: :repl', 'E121: Undefined variable: s:notexist', 1)
1507
1508 lines =<< trim END
1509 s-pat-repl
1510 END
1511 CheckDefAndScriptFailure(lines, 'E1241:', 1)
1512
1513 lines =<< trim END
1514 w:notexist->len()
1515 END
1516 CheckDefExecAndScriptFailure(lines, 'E121: Undefined variable: w:notexist', 1)
1517
1518 lines =<< trim END
1519 b:notexist->len()
1520 END
1521 CheckDefExecAndScriptFailure(lines, 'E121: Undefined variable: b:notexist', 1)
1522
1523 lines =<< trim END
1524 t:notexist->len()
1525 END
1526 CheckDefExecAndScriptFailure(lines, 'E121: Undefined variable: t:notexist', 1)
1527 enddef
1528
1529 def Test_no_space_after_command()
1530 var lines =<< trim END
1531 g /pat/cmd
1532 END
1533 CheckDefAndScriptFailure(lines, 'E1242:', 1)
1534
1535 lines =<< trim END
1536 s /pat/repl
1537 END
1538 CheckDefAndScriptFailure(lines, 'E1242:', 1)
1539 enddef
1540
1492 1541
1493 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker 1542 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker