summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-31 19:13:58 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-31 19:13:58 +0200
commit5d69fdb7c4b91faf2d92b8d449cc9460f3035fb3 (patch)
tree384a1f061d6dd2822e83adeff2f140191ed2f6de /src
parentf1699968baf3619a4147b44c891ba4a0985e7656 (diff)
patch 8.1.1952: more functions can be used as a methodv8.1.1952
Problem: More functions can be used as a method. Solution: Allow more functions to be used as a method.
Diffstat (limited to 'src')
-rw-r--r--src/evalfunc.c14
-rw-r--r--src/testdir/test_bufwintabinfo.vim2
-rw-r--r--src/testdir/test_escaped_glob.vim4
-rw-r--r--src/testdir/test_getvar.vim4
-rw-r--r--src/testdir/test_glob2regpat.vim2
-rw-r--r--src/testdir/test_tagjump.vim2
-rw-r--r--src/testdir/test_terminal.vim3
-rw-r--r--src/version.c2
8 files changed, 19 insertions, 14 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 45b78e34e5..4561f08a34 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -584,15 +584,15 @@ static funcentry_T global_functions[] =
{"gettabinfo", 0, 1, FEARG_1, f_gettabinfo},
{"gettabvar", 2, 3, FEARG_1, f_gettabvar},
{"gettabwinvar", 3, 4, FEARG_1, f_gettabwinvar},
- {"gettagstack", 0, 1, 0, f_gettagstack},
- {"getwininfo", 0, 1, 0, f_getwininfo},
- {"getwinpos", 0, 1, 0, f_getwinpos},
+ {"gettagstack", 0, 1, FEARG_1, f_gettagstack},
+ {"getwininfo", 0, 1, FEARG_1, f_getwininfo},
+ {"getwinpos", 0, 1, FEARG_1, f_getwinpos},
{"getwinposx", 0, 0, 0, f_getwinposx},
{"getwinposy", 0, 0, 0, f_getwinposy},
- {"getwinvar", 2, 3, 0, f_getwinvar},
- {"glob", 1, 4, 0, f_glob},
- {"glob2regpat", 1, 1, 0, f_glob2regpat},
- {"globpath", 2, 5, 0, f_globpath},
+ {"getwinvar", 2, 3, FEARG_1, f_getwinvar},
+ {"glob", 1, 4, FEARG_1, f_glob},
+ {"glob2regpat", 1, 1, FEARG_1, f_glob2regpat},
+ {"globpath", 2, 5, FEARG_2, f_globpath},
{"has", 1, 1, 0, f_has},
{"has_key", 2, 2, FEARG_1, f_has_key},
{"haslocaldir", 0, 2, 0, f_haslocaldir},
diff --git a/src/testdir/test_bufwintabinfo.vim b/src/testdir/test_bufwintabinfo.vim
index d9b3691e41..4e2c5d284e 100644
--- a/src/testdir/test_bufwintabinfo.vim
+++ b/src/testdir/test_bufwintabinfo.vim
@@ -77,7 +77,7 @@ function Test_getbufwintabinfo()
call assert_equal('green', winlist[2].variables.signal)
call assert_equal(w4_id, winlist[3].winid)
- let winfo = getwininfo(w5_id)[0]
+ let winfo = w5_id->getwininfo()[0]
call assert_equal(2, winfo.tabnr)
call assert_equal([], getwininfo(3))
diff --git a/src/testdir/test_escaped_glob.vim b/src/testdir/test_escaped_glob.vim
index a03c18047c..da5963e7c7 100644
--- a/src/testdir/test_escaped_glob.vim
+++ b/src/testdir/test_escaped_glob.vim
@@ -16,7 +16,7 @@ function Test_glob()
" Execute these commands in the sandbox, so that using the shell fails.
" Setting 'shell' to an invalid name causes a memory leak.
sandbox call assert_equal("", glob('Xxx\{'))
- sandbox call assert_equal("", glob('Xxx\$'))
+ sandbox call assert_equal("", 'Xxx\$'->glob())
w! Xxx\{
w! Xxx\$
sandbox call assert_equal("Xxx{", glob('Xxx\{'))
@@ -29,5 +29,5 @@ function Test_globpath()
sandbox call assert_equal("sautest/autoload/globone.vim\nsautest/autoload/globtwo.vim",
\ globpath('sautest/autoload', 'glob*.vim'))
sandbox call assert_equal(['sautest/autoload/globone.vim', 'sautest/autoload/globtwo.vim'],
- \ globpath('sautest/autoload', 'glob*.vim', 0, 1))
+ \ 'glob*.vim'->globpath('sautest/autoload', 0, 1))
endfunction
diff --git a/src/testdir/test_getvar.vim b/src/testdir/test_getvar.vim
index e9868c7887..5a96548893 100644
--- a/src/testdir/test_getvar.vim
+++ b/src/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, ''))
diff --git a/src/testdir/test_glob2regpat.vim b/src/testdir/test_glob2regpat.vim
index e6e41f13e7..29c8d99ec0 100644
--- a/src/testdir/test_glob2regpat.vim
+++ b/src/testdir/test_glob2regpat.vim
@@ -8,7 +8,7 @@ endfunc
func Test_glob2regpat_valid()
call assert_equal('^foo\.', glob2regpat('foo.*'))
- call assert_equal('^foo.$', glob2regpat('foo?'))
+ call assert_equal('^foo.$', 'foo?'->glob2regpat())
call assert_equal('\.vim$', glob2regpat('*.vim'))
call assert_equal('^[abc]$', glob2regpat('[abc]'))
call assert_equal('^foo bar$', glob2regpat('foo\ bar'))
diff --git a/src/testdir/test_tagjump.vim b/src/testdir/test_tagjump.vim
index e4084b314a..4c16129a21 100644
--- a/src/testdir/test_tagjump.vim
+++ b/src/testdir/test_tagjump.vim
@@ -268,7 +268,7 @@ func Test_getsettagstack()
enew | only
call settagstack(1, {'items' : []})
call assert_equal(0, gettagstack(1).length)
- call assert_equal([], gettagstack(1).items)
+ call assert_equal([], 1->gettagstack().items)
" Error cases
call assert_equal({}, gettagstack(100))
call assert_equal(-1, settagstack(100, {'items' : []}))
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index e173b42b83..39956bafba 100644
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -2066,6 +2066,9 @@ func Test_terminal_getwinpos()
" In the GUI it can be more, let's assume a 20 x 14 cell.
" And then add 100 / 200 tolerance.
let [xroot, yroot] = getwinpos()
+ let winpos = 50->getwinpos()
+ call assert_equal(xroot, winpos[0])
+ call assert_equal(yroot, winpos[1])
let [winrow, wincol] = win_screenpos('.')
let xoff = wincol * (has('gui_running') ? 14 : 7) + 100
let yoff = winrow * (has('gui_running') ? 20 : 10) + 200
diff --git a/src/version.c b/src/version.c
index 00e82da91a..067e176d81 100644
--- a/src/version.c
+++ b/src/version.c
@@ -762,6 +762,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1952,
+/**/
1951,
/**/
1950,