Mercurial > vim
comparison src/testdir/test_bufwintabinfo.vim @ 21381:95e6fb6a5c86 v8.2.1241
patch 8.2.1241: cannot use getbufinfo() as a method
Commit: https://github.com/vim/vim/commit/6434fc574dfbde11461e70e5a62712370edf38e6
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 18 22:24:22 2020 +0200
patch 8.2.1241: cannot use getbufinfo() as a method
Problem: Cannot use getbufinfo() as a method.
Solution: Support using getbufinfo() as a method. (closes https://github.com/vim/vim/issues/6458)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 18 Jul 2020 22:30:04 +0200 |
parents | 94f05de75e9f |
children | 08940efa6b4e |
comparison
equal
deleted
inserted
replaced
21380:17c6dd970b13 | 21381:95e6fb6a5c86 |
---|---|
20 let b:editor = 'vim' | 20 let b:editor = 'vim' |
21 let l = getbufinfo('%') | 21 let l = getbufinfo('%') |
22 call assert_equal(bufnr('%'), l[0].bufnr) | 22 call assert_equal(bufnr('%'), l[0].bufnr) |
23 call assert_equal('vim', l[0].variables.editor) | 23 call assert_equal('vim', l[0].variables.editor) |
24 call assert_notequal(-1, index(l[0].windows, '%'->bufwinid())) | 24 call assert_notequal(-1, index(l[0].windows, '%'->bufwinid())) |
25 | |
26 let l = '%'->getbufinfo() | |
27 call assert_equal(bufnr('%'), l[0].bufnr) | |
25 | 28 |
26 " Test for getbufinfo() with 'bufmodified' | 29 " Test for getbufinfo() with 'bufmodified' |
27 call assert_equal(0, len(getbufinfo({'bufmodified' : 1}))) | 30 call assert_equal(0, len(getbufinfo({'bufmodified' : 1}))) |
28 call setbufline('Xtestfile1', 1, ["Line1"]) | 31 call setbufline('Xtestfile1', 1, ["Line1"]) |
29 let l = getbufinfo({'bufmodified' : 1}) | 32 let l = getbufinfo({'bufmodified' : 1}) |