Mercurial > vim
diff src/testdir/test_vim9_cmd.vim @ 23966:09bde146adcb v8.2.2525
patch 8.2.2525: Vim9: only local variables checked for a name
Commit: https://github.com/vim/vim/commit/e0890d678d4d31ca1810c90f3afe2ba89dfedcfa
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Feb 17 14:52:14 2021 +0100
patch 8.2.2525: Vim9: only local variables checked for a name
Problem: Vim9: only local variables checked for a name.
Solution: Also check arguments and script variables. (closes https://github.com/vim/vim/issues/7838)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 17 Feb 2021 15:00:04 +0100 |
parents | 2a885d095bff |
children | fc4c2beea99a |
line wrap: on
line diff
--- a/src/testdir/test_vim9_cmd.vim +++ b/src/testdir/test_vim9_cmd.vim @@ -323,6 +323,11 @@ def Test_for_linebreak() CheckScriptSuccess(lines) enddef +def MethodAfterLinebreak(arg: string) + arg + ->setline(1) +enddef + def Test_method_call_linebreak() var lines =<< trim END vim9script @@ -361,6 +366,11 @@ def Test_method_call_linebreak() g:shortlist = [1, 2] CheckDefAndScriptSuccess(lines) unlet g:shortlist + + new + MethodAfterLinebreak('foobar') + assert_equal('foobar', getline(1)) + bwipe! enddef def Test_method_call_whitespace()