aboutsummaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
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)',