[Bug]: Outdated bufferline-functions Documentation
mcDevnagh opened this issue · comments
Michael McDonagh commented
Is there an existing issue for this?
- I have searched the existing issues
What happened?
The documentation has an outdated means of executing arbitrary functions on buffers:
bufferline.nvim/doc/bufferline.txt
Line 551 in ac788fb
CUSTOM-FUNCTIONS *bufferline-functions*
A user can also execute arbitrary functions against a buffer using the
`buf_exec` function. For example
>lua
require('bufferline').buf_exec(
4, -- the forth visible buffer from the left
user_function -- an arbitrary user function which gets passed the buffer
)
-- e.g.
function _G.bdel(num)
require('bufferline').buf_exec(num, function(buf, visible_buffers)
vim.cmd('bdelete '..buf.id)
end
end
vim.cmd [[
command -count Bdel <Cmd>lua _G.bdel(<count>)<CR>
]]
The buf_exec
function no longer exists in the bufferline module
The exec
function in the bufferline.commands module seems to be its replacement
What did you expect to happen?
The documentation should contain:
CUSTOM-FUNCTIONS *bufferline-functions*
A user can also execute arbitrary functions against a buffer using the
`exec` function in the `bufferline.commands` module. For example
>lua
require("bufferline.commands").exec(
4, -- the forth visible buffer from the left
user_function -- an arbitrary user function which gets passed the buffer
)
-- e.g.
function _G.bdel(num)
require("bufferline.commands").exec(num, function(bufnr, visible_buffers)
vim.cmd('bdelete '..bufnr)
end
end
vim.cmd [[
command -count Bdel <Cmd>lua _G.bdel(<count>)<CR>
]]
see:
Config
N/A
Additional Information
...
commit
No response
Akin commented
@mcDevnagh thanks for pointing this out please still free to raise a pr and I can review and update the docs