From f01d6c2949b617f00590089190332a1668f6b447 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 28 Jul 2023 17:08:42 +0300 Subject: [PATCH] dev: improve nvim-navic and navbuddy loading logic --- modules/statusline/lualine/config.nix | 5 +++-- modules/ui/breadcrumbs/breadcrumbs.nix | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/statusline/lualine/config.nix b/modules/statusline/lualine/config.nix index 2f8b9624..cff8596c 100644 --- a/modules/statusline/lualine/config.nix +++ b/modules/statusline/lualine/config.nix @@ -49,16 +49,17 @@ in { lualine_z = ${cfg.inactiveSection.z}, }, tabline = {}, + + ${optionalString (config.vim.ui.breadcrumbs.source == "nvim-navic") '' winbar = { lualine_c = { { "navic", - color_correction = nil, - navic_opts = nil, draw_empty = ${toString config.vim.ui.breadcrumbs.alwaysRender} } } }, + ''} extensions = {${ if (config.vim.filetree.nvimTreeLua.enable) then "\"nvim-tree\"" diff --git a/modules/ui/breadcrumbs/breadcrumbs.nix b/modules/ui/breadcrumbs/breadcrumbs.nix index b220538b..d54328ff 100644 --- a/modules/ui/breadcrumbs/breadcrumbs.nix +++ b/modules/ui/breadcrumbs/breadcrumbs.nix @@ -8,10 +8,10 @@ in { options.vim.ui.breadcrumbs = { enable = lib.mkEnableOption "breadcrumbs"; source = mkOption { - type = types.enum ["nvim-navic"]; # TODO: lspsaga and dropbar + type = with types; nullOr (enum ["nvim-navic"]); # TODO: lspsaga and dropbar default = "nvim-navic"; description = '' - The source to be used for breadcrumbs component + The source to be used for breadcrumbs component. Null means no breadcrumbs. ''; }; @@ -24,13 +24,13 @@ in { }; navbuddy = { - enable = mkEnableOption "navbuddy LSP UI"; + enable = mkEnableOption "navbuddy LSP helper UI. Enabling this option automatically loads and enables nvim-navic"; # this option is interpreted as null if mkEnableOption is used, and therefore cannot be converted to a string in config.nix useDefaultMappings = mkOption { type = types.bool; default = true; - description = "default Navbuddy keybindings (disables user-specified keybinds)"; + description = "use default Navbuddy keybindings (disables user-specified keybinds)"; }; mappings = {