Skip to content

Commit 4b30847

Browse files
authored
docs: clarify root_folder_label=false (not true) to disable, tidy nvim_tree_config.renderer help (#3286)
docs: root_folder_label=false to disable, tidy nvim_tree_config.renderer help
1 parent c8d8d51 commit 4b30847

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

doc/nvim-tree-lua.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,9 +1231,11 @@ Config: renderer *nvim-tree-config-renderer*
12311231

12321232
Specify {decorators} is a list e.g. `{ "Git", MyDecorator, "Cut" }`
12331233

1234-
{root_folder_label} has 3 forms:
1234+
{root_folder_label} *nvim_tree.config.renderer.root_folder_label*
1235+
1236+
Controls the root folder name and visibility:
12351237
`string`: |filename-modifiers| format string, default `":~:s?$?/..?"`
1236-
`boolean`: `true` to disable
1238+
`false`: to disable
12371239
• `fun(root_cwd: string): string`: return a literal string from root's
12381240
absolute path e.g. >lua
12391241
my_root_folder_label = function(path)
@@ -1266,8 +1268,8 @@ Config: renderer *nvim-tree-config-renderer*
12661268
• {full_name}? (`boolean`, default: `false`) Display nodes
12671269
whose name length is wider than the width
12681270
of nvim-tree window in floating window.
1269-
• {root_folder_label}? (`string|boolean|(fun(root_cwd: string): string)`)
1270-
(default: `":~:s?$?/..?"`)
1271+
• {root_folder_label}? (`nvim_tree.config.renderer.root_folder_label`, default: `":~:s?$?/..?"`)
1272+
|nvim_tree.config.renderer.root_folder_label|
12711273
• {indent_width}? (`integer`, default: `2`) Number of spaces
12721274
for each tree nesting level. Minimum 1.
12731275
• {hidden_display}? (`nvim_tree.config.renderer.hidden_display`, default: `none`)

lua/nvim-tree/_meta/config/renderer.lua

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,18 @@ error("Cannot require a meta file")
3939
---
4040
---
4141
---
42-
---{root_folder_label} has 3 forms:
42+
---{root_folder_label} [nvim_tree.config.renderer.root_folder_label]()
43+
---
44+
---Controls the root folder name and visibility:
4345
---- `string`: [filename-modifiers] format string, default `":~:s?$?/..?"`
44-
---- `boolean`: `true` to disable
46+
---- `false`: to disable
4547
---- `fun(root_cwd: string): string`: return a literal string from root's absolute path e.g.
4648
---```lua
4749
--- my_root_folder_label = function(path)
4850
--- return ".../" .. vim.fn.fnamemodify(path, ":t")
4951
--- end
5052
---```
53+
---@alias nvim_tree.config.renderer.root_folder_label string|false|(fun(root_cwd: string): string)
5154
---
5255
---
5356
---
@@ -80,8 +83,9 @@ error("Cannot require a meta file")
8083
---(default: `false`)
8184
---@field full_name? boolean
8285
---
86+
---[nvim_tree.config.renderer.root_folder_label]
8387
---(default: `":~:s?$?/..?"`)
84-
---@field root_folder_label? string|boolean|(fun(root_cwd: string): string)
88+
---@field root_folder_label? nvim_tree.config.renderer.root_folder_label
8589
---
8690
---Number of spaces for each tree nesting level. Minimum 1.
8791
---(default: `2`)

0 commit comments

Comments
 (0)