aboutsummaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
authorRaphael <glepnir@neovim.pro>2022-08-25 06:00:56 +0800
committerGitHub <noreply@github.com>2022-08-25 06:00:56 +0800
commit727fc415edad27d2664866543a2e4788e10fd927 (patch)
tree231c90a0c718e301410f962ade0e1778de451ee9 /plugin
parentfeat: sort autocompletion items alphabetically (#2084) (diff)
downloadnvim-lspconfig-727fc415edad27d2664866543a2e4788e10fd927.tar
nvim-lspconfig-727fc415edad27d2664866543a2e4788e10fd927.tar.gz
nvim-lspconfig-727fc415edad27d2664866543a2e4788e10fd927.tar.bz2
nvim-lspconfig-727fc415edad27d2664866543a2e4788e10fd927.tar.lz
nvim-lspconfig-727fc415edad27d2664866543a2e4788e10fd927.tar.xz
nvim-lspconfig-727fc415edad27d2664866543a2e4788e10fd927.tar.zst
nvim-lspconfig-727fc415edad27d2664866543a2e4788e10fd927.zip
fix: LspStop should be only stop the current buffer servers by default (#2082)
* fix: LspStop should be only stop the current buffer server by default * fix: check filetypes in if statement
Diffstat (limited to 'plugin')
-rw-r--r--plugin/lspconfig.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugin/lspconfig.lua b/plugin/lspconfig.lua
index bb79da1e..117e51e9 100644
--- a/plugin/lspconfig.lua
+++ b/plugin/lspconfig.lua
@@ -86,8 +86,12 @@ end, {
})
vim.api.nvim_create_user_command('LspStop', function(info)
+ local current_buf = vim.api.nvim_get_current_buf()
for _, client in ipairs(get_clients_from_cmd_args(info.args)) do
- client.stop()
+ local filetypes = client.config.filetypes
+ if filetypes and vim.tbl_contains(filetypes, vim.bo[current_buf].filetype) then
+ client.stop()
+ end
end
end, {
desc = 'Manually stops the given language client(s)',