mirror of
https://github.com/neovim/neovim.git
synced 2026-04-22 23:35:32 +00:00
feat(api): rename buffer to buf #35330
Problem: `:help dev-name-common` states that "buf" should be used instead of "buffer" but there are cases where buffer is mentioned in the lua API. Solution: - Rename occurrences of "buffer" to "buf" for consistency with the documentation. - Support (but deprecate) "buffer" for backwards compatibility. Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
This commit is contained in:
@@ -936,7 +936,7 @@ local function buf_attach(bufnr)
|
||||
local group = api.nvim_create_augroup(augroup, { clear = true })
|
||||
api.nvim_create_autocmd('BufWritePre', {
|
||||
group = group,
|
||||
buffer = bufnr,
|
||||
buf = bufnr,
|
||||
desc = 'vim.lsp: textDocument/willSave',
|
||||
callback = function(ctx)
|
||||
for _, client in ipairs(lsp.get_clients({ bufnr = ctx.buf })) do
|
||||
@@ -963,7 +963,7 @@ local function buf_attach(bufnr)
|
||||
})
|
||||
api.nvim_create_autocmd('BufWritePost', {
|
||||
group = group,
|
||||
buffer = bufnr,
|
||||
buf = bufnr,
|
||||
desc = 'vim.lsp: textDocument/didSave handler',
|
||||
callback = function(ctx)
|
||||
text_document_did_save_handler(ctx.buf)
|
||||
|
||||
Reference in New Issue
Block a user