mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 15:38:33 +00:00
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.
5d69fdb7c4
This commit is contained in:
@@ -172,15 +172,15 @@ return {
|
||||
gettabinfo={args={0, 1}, base=1},
|
||||
gettabvar={args={2, 3}, base=1},
|
||||
gettabwinvar={args={3, 4}, base=1},
|
||||
gettagstack={args={0, 1}},
|
||||
getwininfo={args={0, 1}},
|
||||
getwinpos={args={0, 1}},
|
||||
gettagstack={args={0, 1}, base=1},
|
||||
getwininfo={args={0, 1}, base=1},
|
||||
getwinpos={args={0, 1}, base=1},
|
||||
getwinposx={},
|
||||
getwinposy={},
|
||||
getwinvar={args={2, 3}},
|
||||
glob={args={1, 4}},
|
||||
glob2regpat={args=1},
|
||||
globpath={args={2, 5}},
|
||||
getwinvar={args={2, 3}, base=1},
|
||||
glob={args={1, 4}, base=1},
|
||||
glob2regpat={args=1, base=1},
|
||||
globpath={args={2, 5}, base=2},
|
||||
has={args=1},
|
||||
has_key={args=2, base=1},
|
||||
haslocaldir={args={0,2}},
|
||||
|
@@ -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))
|
||||
|
||||
|
@@ -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\{
|
||||
" } to fix highlighting
|
||||
w! Xxx\$
|
||||
@@ -28,7 +28,7 @@ endfunction
|
||||
|
||||
function Test_globpath()
|
||||
sandbox call assert_equal(expand("sautest/autoload/globone.vim\nsautest/autoload/globtwo.vim"),
|
||||
\ globpath('sautest/autoload', 'glob*.vim'))
|
||||
\ globpath('sautest/autoload', 'glob*.vim'))
|
||||
sandbox call assert_equal([expand('sautest/autoload/globone.vim'), expand('sautest/autoload/globtwo.vim')],
|
||||
\ globpath('sautest/autoload', 'glob*.vim', 0, 1))
|
||||
\ 'glob*.vim'->globpath('sautest/autoload', 0, 1))
|
||||
endfunction
|
||||
|
@@ -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, ''))
|
||||
|
@@ -10,7 +10,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'))
|
||||
|
@@ -316,7 +316,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' : []}))
|
||||
|
Reference in New Issue
Block a user