From 863047e49005ffcb5f2a7af198bd6e2b000c9616 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Wed, 19 Jul 2023 23:06:06 +0300 Subject: [PATCH] dev: allow nvim-navic to attach to the Lsp if breadcrumbs is enabled --- modules/lsp/config.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/lsp/config.nix b/modules/lsp/config.nix index 1085118..83da30b 100644 --- a/modules/lsp/config.nix +++ b/modules/lsp/config.nix @@ -81,9 +81,16 @@ in { end end + ${optionalString (config.vim.ui.breadcrumbs.enable) ''local navic = require("nvim-navic")''} default_on_attach = function(client, bufnr) attach_keymaps(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 local capabilities = vim.lsp.protocol.make_client_capabilities()