Skip to content

[audit] fix: use "buf" instead of deprecated "buffer" key in keymap opts - #331

Draft
stanfish06 wants to merge 1 commit into
masterfrom
audit/lsp-keymap-buf-key
Draft

[audit] fix: use "buf" instead of deprecated "buffer" key in keymap opts#331
stanfish06 wants to merge 1 commit into
masterfrom
audit/lsp-keymap-buf-key

Conversation

@stanfish06

Copy link
Copy Markdown
Owner

What

runtime/doc/deprecated.txt (deprecated-0.12 section) renames the "buffer" key accepted by vim.keymap.set.Opts / vim.keymap.del.Opts to "buf". lua/config/lsp.lua:8 defines local BUF = "buffer", which is used as the buffer-local option key for the two LspAttach keymaps (gd, <leader>la) at lines 136-137. That's the old, deprecated spelling.

Where

lua/config/lsp.lua:8 (and its two use sites at :136 and :137, unchanged — only the constant's value changes).

Why it matters

Confirmed via runtime/doc/deprecated.txt on neovim/neovim master:

• "buffer" in `vim.keymap.set.Opts` and `vim.keymap.del.Opts`	Renamed to "buf"

This is the only place in the repo using the old key — plugin_config.lua's "buffer" string is an unrelated blink.cmp completion source name, not a keymap opts key (verified via repo-wide grep). Left as-is, this keeps emitting a deprecation warning today and will break once Neovim removes the old key outright, same pattern as the other option/API renames already tracked in #283.

Fix

One-line rename of the BUF constant from "buffer" to "buf". No behavior change — both spellings currently work identically, this just uses the current name.


Generated by Claude Code

vim.keymap.set.Opts renamed "buffer" to "buf" (runtime/doc/deprecated.txt).
lsp.lua's BUF constant still used the old name for the two buffer-local
LspAttach keymaps (gd, <leader>la). No behavior change, just drops the
deprecation warning ahead of it becoming a hard error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants