dev: allow nvim-navic to attach to the Lsp if breadcrumbs is enabled

This commit is contained in:
NotAShelf 2023-07-19 23:06:06 +03:00
parent 41584157eb
commit 863047e490
No known key found for this signature in database
GPG Key ID: 02D1DD3FA08B6B29
1 changed files with 7 additions and 0 deletions

View File

@ -81,9 +81,16 @@ in {
end end
end end
${optionalString (config.vim.ui.breadcrumbs.enable) ''local navic = require("nvim-navic")''}
default_on_attach = function(client, bufnr) default_on_attach = function(client, bufnr)
attach_keymaps(client, bufnr) attach_keymaps(client, bufnr)
format_callback(client, bufnr) format_callback(client, bufnr)
${optionalString (config.vim.ui.breadcrumbs.enable) ''
-- let navic attach to buffers
if client.server_capabilities.documentSymbolProvider then
navic.attach(client, bufnr)
end
''}
end end
local capabilities = vim.lsp.protocol.make_client_capabilities() local capabilities = vim.lsp.protocol.make_client_capabilities()