mirror of
https://github.com/neovim/neovim.git
synced 2026-04-23 15:55:36 +00:00
backport: feat(api): rename buffer to buf (#38899)
feat(api): rename buffer to buf 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: Jordan <46637683+JordanllHarper@users.noreply.github.com>
This commit is contained in:
@@ -165,7 +165,7 @@ function properties.trim_trailing_whitespace(bufnr, val)
|
||||
if val == 'true' then
|
||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||
group = 'nvim.editorconfig',
|
||||
buffer = bufnr,
|
||||
buf = bufnr,
|
||||
callback = function()
|
||||
local view = vim.fn.winsaveview()
|
||||
vim.api.nvim_command('silent! undojoin')
|
||||
@@ -177,7 +177,7 @@ function properties.trim_trailing_whitespace(bufnr, val)
|
||||
vim.api.nvim_clear_autocmds({
|
||||
event = 'BufWritePre',
|
||||
group = 'nvim.editorconfig',
|
||||
buffer = bufnr,
|
||||
buf = bufnr,
|
||||
})
|
||||
end
|
||||
end
|
||||
@@ -194,7 +194,7 @@ function properties.insert_final_newline(bufnr, val)
|
||||
if vim.bo[bufnr].endofline ~= endofline then
|
||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||
group = 'nvim.editorconfig',
|
||||
buffer = bufnr,
|
||||
buf = bufnr,
|
||||
once = true,
|
||||
callback = function()
|
||||
vim.bo[bufnr].endofline = endofline
|
||||
|
||||
Reference in New Issue
Block a user