aboutsummaryrefslogtreecommitdiffstats
path: root/lsp/basedpyright.lua
diff options
context:
space:
mode:
authorDmytro Meleshko <dmytro.meleshko@gmail.com>2025-06-20 15:07:25 +0200
committerGitHub <noreply@github.com>2025-06-20 06:07:25 -0700
commit0112e1f77983141e1453bd37d124302f1c876c46 (patch)
tree860eaf1a98cba84bc04706b3e327f4afb75eed71 /lsp/basedpyright.lua
parentfix(powershell_es): set LogLevel to "Information" #3914 (diff)
downloadnvim-lspconfig-0112e1f77983141e1453bd37d124302f1c876c46.tar
nvim-lspconfig-0112e1f77983141e1453bd37d124302f1c876c46.tar.gz
nvim-lspconfig-0112e1f77983141e1453bd37d124302f1c876c46.tar.bz2
nvim-lspconfig-0112e1f77983141e1453bd37d124302f1c876c46.tar.lz
nvim-lspconfig-0112e1f77983141e1453bd37d124302f1c876c46.tar.xz
nvim-lspconfig-0112e1f77983141e1453bd37d124302f1c876c46.tar.zst
nvim-lspconfig-0112e1f77983141e1453bd37d124302f1c876c46.zip
fix: some `on_attach` callbacks may act on the wrong buffer #3916
Problem: If a server is attached to a non-current buffer by `vim.lsp.buf_attach_client`, then the Language Server-related commands may be created in the current (wrong) buffer. Solution: Always use the `bufnr` arg provided to `on_attach`.
Diffstat (limited to 'lsp/basedpyright.lua')
-rw-r--r--lsp/basedpyright.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/lsp/basedpyright.lua b/lsp/basedpyright.lua
index 8872ea14..2ec59448 100644
--- a/lsp/basedpyright.lua
+++ b/lsp/basedpyright.lua
@@ -50,7 +50,7 @@ return {
desc = 'Organize Imports',
})
- vim.api.nvim_buf_create_user_command(0, 'LspPyrightSetPythonPath', set_python_path, {
+ vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightSetPythonPath', set_python_path, {
desc = 'Reconfigure basedpyright with the provided python path',
nargs = 1,
complete = 'file',