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:
Justin M. Keyes
2026-04-08 21:23:13 -04:00
committed by GitHub
parent 8669e34bba
commit ed47b27ad4
27 changed files with 307 additions and 176 deletions

View File

@@ -1155,7 +1155,7 @@ local function show_confirm_buf(lines, on_finish)
delete_buffer()
end
-- - Use `nested` to allow other events (useful for statuslines)
api.nvim_create_autocmd('BufWriteCmd', { buffer = bufnr, nested = true, callback = finish })
api.nvim_create_autocmd('BufWriteCmd', { buf = bufnr, nested = true, callback = finish })
-- Define action to cancel confirm
--- @type integer