mirror of
https://github.com/neovim/neovim.git
synced 2026-04-30 11:14:10 +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:
@@ -703,7 +703,7 @@ function Client:_process_request(id, req_type, bufnr, method)
|
||||
self.requests[id] = req_type ~= 'complete' and request or nil
|
||||
|
||||
api.nvim_exec_autocmds('LspRequest', {
|
||||
buffer = api.nvim_buf_is_valid(bufnr) and bufnr or nil,
|
||||
buf = api.nvim_buf_is_valid(bufnr) and bufnr or nil,
|
||||
modeline = false,
|
||||
data = { client_id = self.id, request_id = id, request = request },
|
||||
})
|
||||
@@ -1152,7 +1152,7 @@ function Client:on_attach(bufnr)
|
||||
lsp._set_defaults(self, bufnr)
|
||||
|
||||
api.nvim_exec_autocmds('LspAttach', {
|
||||
buffer = bufnr,
|
||||
buf = bufnr,
|
||||
modeline = false,
|
||||
data = { client_id = self.id },
|
||||
})
|
||||
@@ -1335,7 +1335,7 @@ end
|
||||
function Client:_on_detach(bufnr)
|
||||
if self.attached_buffers[bufnr] and api.nvim_buf_is_valid(bufnr) then
|
||||
api.nvim_exec_autocmds('LspDetach', {
|
||||
buffer = bufnr,
|
||||
buf = bufnr,
|
||||
modeline = false,
|
||||
data = { client_id = self.id },
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user