fix(fugitive): disable lsp in diff buffers

This commit is contained in:
Simon Lasbrugnas 2026-01-19 16:37:55 +01:00
parent d54bff58d4
commit 1b295597f4
No known key found for this signature in database
GPG key ID: 43F4DC559B52E7FA

View file

@ -72,3 +72,16 @@ vim.api.nvim_create_autocmd("BufWritePost", {
end
end,
})
-- Disable LSP in fugitive buffers
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
local bufnr = args.buf
if vim.api.nvim_buf_get_name(bufnr):match("^fugitive://") then
if client then
vim.lsp.stop_client(client.id)
end
end
end,
})