Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/nvim-tree-lua.txt
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ Window / buffer setup.

*nvim-tree.view.float.open_win_config*
Floating window config. See |nvim_open_win| for more details.
Type: `table`, Default:
Type: `table` or `function` that returns a table, Default:
`{`
`relative = "editor",`
`border = "rounded",`
Expand Down
10 changes: 9 additions & 1 deletion lua/nvim-tree/view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,17 @@ local function set_window_options_and_buffer()
end
end

local function open_win_config()
if type(M.View.float.open_win_config) == "function" then
return M.View.float.open_win_config()
else
return M.View.float.open_win_config
end
end

local function open_window()
if M.View.float.enable then
a.nvim_open_win(0, true, M.View.float.open_win_config)
a.nvim_open_win(0, true, open_win_config())
else
a.nvim_command "vsp"
M.reposition_window()
Expand Down