[audit] Fix deprecated buffer key in vim.keymap.set opts (Neovim 0.12)#137
Merged
Conversation
Neovim 0.12 deprecates the `buffer` option key in `vim.keymap.set()` /
`vim.keymap.del()` in favour of `buf`. The LspAttach callback in
plugin_config.lua was using the old form `{ buffer = ev.buf }`.
https://claude.ai/code/session_01PJNb6QtQTFur5vCNVVccfX
Owner
Author
|
@claude , make it backward compatible, not all of my machines are on v12 |
|
Claude finished @stanfish06's task in 52s —— View job Backward-compatible
|
Use buf on 0.12+ (where buffer is deprecated) and fall back to buffer on older Neovim versions. Co-authored-by: Zhiyuan <stanfish06@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Neovim 0.12 deprecates the
bufferoption key invim.keymap.set()/vim.keymap.del()in favour ofbuf.Where
lua/config/plugin_config.lua:112— inside theLspAttachautocmd callback:Why it matters
The config targets Neovim 0.12+ (uses
vim.pack,vim.lsp.config,vim.lsp.enable,completeopt = "fuzzy",winborder, all 0.11/0.12 APIs). Using the deprecatedbufferkey will produce a deprecation warning in 0.12 and will stop working in a future release once the key is removed.Change
One-line rename:
buffer = ev.buf→buf = ev.bufin theoptstable passed tovim.keymap.set("n", "gd", ...).References
:help news-0.12→ vim.keymap sectiondeprecated.txt:vim.keymap.set()/del()bufferoption →bufGenerated by Claude Code