Skip to content

Commit e153d9f

Browse files
fix(#2440): view.width.padding may be a number or function returning a number (#2442)
* fix validation view.width.padding * fix docs for view.width.padding * fix docs for view.width.padding --------- Co-authored-by: Alexander Courtis <alex@courtis.org>
1 parent 7dcda5d commit e153d9f

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

doc/nvim-tree-lua.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -734,19 +734,23 @@ Width of the window: can be a `%` string, a number representing columns, a
734734
function or a table.
735735
A table indicates that the view should be dynamically sized based on the
736736
longest line (previously `view.adaptive_size`).
737-
Type: `string | number | function | table`, Default: `30`
737+
Type: `string | number | table | function()` returning a number
738+
Default: `30`
738739

739740
*nvim-tree.view.width.min*
740741
Minimum dynamic width.
741-
Type: `string | number | function`, Default: `30`
742+
Type: `string | number | function()` returning a number
743+
Default: `30`
742744

743745
*nvim-tree.view.width.max*
744746
Maximum dynamic width, -1 for unbounded.
745-
Type: `string | number | function`, Default: `-1`
747+
Type: `string | number | function()` returning a number
748+
Default: `-1`
746749

747750
*nvim-tree.view.width.padding*
748751
Extra padding to the right.
749-
Type: `string`, Default: `" "`
752+
Type: `number | function()` returning a number
753+
Default: `1`
750754

751755
*nvim-tree.view.float*
752756
Use nvim-tree in a floating window.
@@ -761,7 +765,8 @@ Use nvim-tree in a floating window.
761765

762766
*nvim-tree.view.float.open_win_config*
763767
Floating window config. See |nvim_open_win| for more details.
764-
Type: `table` or `function` that returns a table, Default:
768+
Type: `table | function` returning a table
769+
Default:
765770
`{`
766771
`relative = "editor",`
767772
`border = "rounded",`

lua/nvim-tree.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ local ACCEPTED_TYPES = {
642642
"table",
643643
min = { "string", "function", "number" },
644644
max = { "string", "function", "number" },
645+
padding = { "function", "number" },
645646
},
646647
},
647648
renderer = {

0 commit comments

Comments
 (0)