From e480be7ac5c9190d04bf3f31c15bde8bc11fd5c1 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sat, 15 Apr 2023 11:29:49 +0300 Subject: [PATCH] fix: deprecated view.hide-root-folder opt --- extra.nix | 3 +++ modules/filetree/nvimtree-lua/config.nix | 7 ++++++- modules/filetree/nvimtree-lua/nvimtree-lua.nix | 12 ++++++------ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/extra.nix b/extra.nix index 55a2f6a..02ee01c 100644 --- a/extra.nix +++ b/extra.nix @@ -88,6 +88,9 @@ inputs: let vim.filetree = { nvimTreeLua = { enable = true; + renderer = { + rootFolderLabel = null; + }; view = { width = 25; }; diff --git a/modules/filetree/nvimtree-lua/config.nix b/modules/filetree/nvimtree-lua/config.nix index 6546232..4267b02 100644 --- a/modules/filetree/nvimtree-lua/config.nix +++ b/modules/filetree/nvimtree-lua/config.nix @@ -80,7 +80,6 @@ in { width = ${toString cfg.view.width}, side = ${"'" + cfg.view.side + "'"}, adaptive_size = ${boolToString cfg.view.adaptiveSize}, - hide_root_folder = ${boolToString cfg.view.hideRootFolder}, }, git = { enable = ${boolToString cfg.git.enable}, @@ -119,6 +118,12 @@ in { -- TODO: those two add_trailing = ${boolToString cfg.renderer.trailingSlash}, group_empty = ${boolToString cfg.renderer.groupEmptyFolders}, + + rootFolderLabel = ${ + if cfg.renderer.rootFolderLabel == null + then "false" + else "''${toString cfg.rootFolderLabel}''" + }, }, system_open = { diff --git a/modules/filetree/nvimtree-lua/nvimtree-lua.nix b/modules/filetree/nvimtree-lua/nvimtree-lua.nix index fbd0fb6..33a5508 100644 --- a/modules/filetree/nvimtree-lua/nvimtree-lua.nix +++ b/modules/filetree/nvimtree-lua/nvimtree-lua.nix @@ -160,12 +160,6 @@ with builtins; { description = "Width of the tree in charecters"; type = types.int; }; - - hideRootFolder = mkOption { - default = true; - description = "Hide the root folder"; - type = types.bool; - }; }; git = { @@ -282,6 +276,12 @@ with builtins; { type = types.bool; }; + rootFolderLabel = mkOption { + default = null; + description = "Root folder label. Set null to disable"; + type = with types; nullOr str; + }; + icons = { show = { file = mkOption {