mirror of
https://github.com/vim/vim.git
synced 2025-10-04 05:25:06 -04:00
patch 8.1.1987: more functions can be used as methods
Problem: More functions can be used as methods. Solution: Make various functions usable as a method.
This commit is contained in:
@@ -253,7 +253,7 @@ func Test_resolve_unix()
|
||||
call delete('Xlink')
|
||||
|
||||
silent !ln -s -f Xlink2/ Xlink1
|
||||
call assert_equal('Xlink2', resolve('Xlink1'))
|
||||
call assert_equal('Xlink2', 'Xlink1'->resolve())
|
||||
call assert_equal('Xlink2/', resolve('Xlink1/'))
|
||||
call delete('Xlink1')
|
||||
|
||||
@@ -1413,7 +1413,7 @@ func Test_func_range_with_edit()
|
||||
" is invalid in that buffer.
|
||||
call writefile(['just one line'], 'Xfuncrange2')
|
||||
new
|
||||
call setline(1, range(10))
|
||||
call setline(1, 10->range())
|
||||
write Xfuncrange1
|
||||
call assert_fails('5,8call EditAnotherFile()', 'E16:')
|
||||
|
||||
@@ -1544,7 +1544,7 @@ func Test_readdir()
|
||||
call assert_equal(['bar.txt', 'dir', 'foo.txt'], sort(files))
|
||||
|
||||
" Only results containing "f"
|
||||
let files = readdir('Xdir', { x -> stridx(x, 'f') !=- 1 })
|
||||
let files = 'Xdir'->readdir({ x -> stridx(x, 'f') !=- 1 })
|
||||
call assert_equal(['foo.txt'], sort(files))
|
||||
|
||||
" Only .txt files
|
||||
|
Reference in New Issue
Block a user