aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/doc/eval.txt4
-rw-r--r--src/nvim/eval.lua2
-rw-r--r--src/nvim/testdir/test_bufwintabinfo.vim3
3 files changed, 7 insertions, 2 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index d71381347d..8e6864889c 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -4701,7 +4701,9 @@ getbufinfo([{dict}])
<
To get buffer-local options use: >
getbufvar({bufnr}, '&option_name')
-
+<
+ Can also be used as a |method|: >
+ GetBufnr()->getbufinfo()
<
*getbufline()*
getbufline({buf}, {lnum} [, {end}])
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua
index bbbe84f2a2..75e28df98f 100644
--- a/src/nvim/eval.lua
+++ b/src/nvim/eval.lua
@@ -137,7 +137,7 @@ return {
['function']={args={1, 3}, base=1},
garbagecollect={args={0, 1}},
get={args={2, 3}, base=1},
- getbufinfo={args={0, 1}},
+ getbufinfo={args={0, 1}, base=1},
getbufline={args={2, 3}, base=1},
getbufvar={args={2, 3}, base=1},
getchangelist={args={0, 1}, base=1},
diff --git a/src/nvim/testdir/test_bufwintabinfo.vim b/src/nvim/testdir/test_bufwintabinfo.vim
index d2c99563d9..a6eb93b4be 100644
--- a/src/nvim/testdir/test_bufwintabinfo.vim
+++ b/src/nvim/testdir/test_bufwintabinfo.vim
@@ -20,6 +20,9 @@ function Test_getbufwintabinfo()
call assert_equal('vim', l[0].variables.editor)
call assert_notequal(-1, index(l[0].windows, '%'->bufwinid()))
+ let l = '%'->getbufinfo()
+ call assert_equal(bufnr('%'), l[0].bufnr)
+
" Test for getbufinfo() with 'bufmodified'
call assert_equal(0, len(getbufinfo({'bufmodified' : 1})))
call setbufline('Xtestfile1', 1, ["Line1"])