From 3137c7d63574a86ddc44f11c839e8e58c2994bf9 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Fri, 27 Aug 2021 21:09:37 +0100 Subject: feat(eval/method): partially port v8.1.1925 Adds method call support for all functions in the patch, but it cannot be fully ported due to missing tests for: - getcwd(): requires chdir() and Test_chdir_func() from v8.1.1291. Note that the method call tests for getreg() and getregtype() were removed in v8.2.1547, which has already been ported, but doesn't seem to have been replaced with a new test... This patch also makes getchangelist()'s argument optional (defaults to the current buffer). eval.txt includes a typo for gettabwinvar(), which is fixed in v8.1.1952. --- src/nvim/testdir/test_getvar.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/testdir/test_getvar.vim') diff --git a/src/nvim/testdir/test_getvar.vim b/src/nvim/testdir/test_getvar.vim index 3b61d68ebc..e9868c7887 100644 --- a/src/nvim/testdir/test_getvar.vim +++ b/src/nvim/testdir/test_getvar.vim @@ -31,7 +31,7 @@ func Test_var() let t:other = 777 let def_list = [4, 5, 6, 7] tabrewind - call assert_equal([1, 2, 3], gettabvar(3, 'var_list')) + call assert_equal([1, 2, 3], 3->gettabvar('var_list')) call assert_equal([1, 2, 3], gettabvar(3, 'var_list', def_list)) call assert_equal({'var_list': [1, 2, 3], 'other': 777}, gettabvar(3, '')) call assert_equal({'var_list': [1, 2, 3], 'other': 777}, @@ -61,7 +61,7 @@ func Test_var() let def_dict = {'dict2': 'newval'} wincmd b tabrewind - call assert_equal({'dict': 'tabwin'}, gettabwinvar(2, 3, 'var_dict')) + call assert_equal({'dict': 'tabwin'}, 2->gettabwinvar(3, 'var_dict')) call assert_equal({'dict': 'tabwin'}, \ gettabwinvar(2, 3, 'var_dict', def_dict)) call assert_equal({'var_dict': {'dict': 'tabwin'}}, gettabwinvar(2, 3, '')) -- cgit From 8b7615c735325245cff20907fbd7e0470a0d00d0 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Tue, 31 Aug 2021 22:41:44 +0100 Subject: vim-patch:8.1.1952: more functions can be used as a method Problem: More functions can be used as a method. Solution: Allow more functions to be used as a method. https://github.com/vim/vim/commit/5d69fdb7c4b91faf2d92b8d449cc9460f3035fb3 --- src/nvim/testdir/test_getvar.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/testdir/test_getvar.vim') diff --git a/src/nvim/testdir/test_getvar.vim b/src/nvim/testdir/test_getvar.vim index e9868c7887..5a96548893 100644 --- a/src/nvim/testdir/test_getvar.vim +++ b/src/nvim/testdir/test_getvar.vim @@ -12,8 +12,8 @@ func Test_var() let def_str = "Chance" call assert_equal('Dance', getwinvar(1, 'var_str')) call assert_equal('Dance', getwinvar(1, 'var_str', def_str)) - call assert_equal({'var_str': 'Dance'}, getwinvar(1, '')) - call assert_equal({'var_str': 'Dance'}, getwinvar(1, '', def_str)) + call assert_equal({'var_str': 'Dance'}, 1->getwinvar('')) + call assert_equal({'var_str': 'Dance'}, 1->getwinvar('', def_str)) unlet w:var_str call assert_equal('Chance', getwinvar(1, 'var_str', def_str)) call assert_equal({}, getwinvar(1, '')) -- cgit