Skip to content

Commit 01b63e4

Browse files
committed
feat(open): add window_picker.picker
1 parent c984b76 commit 01b63e4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lua/nvim-tree.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
621621
resize_window = true,
622622
window_picker = {
623623
enable = true,
624-
custom_function = nil,
624+
picker = "default",
625625
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
626626
exclude = {
627627
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
@@ -673,7 +673,6 @@ end
673673

674674
local FIELD_SKIP_VALIDATE = {
675675
open_win_config = true,
676-
custom_function = true,
677676
}
678677

679678
local FIELD_OVERRIDE_TYPECHECK = {
@@ -682,6 +681,7 @@ local FIELD_OVERRIDE_TYPECHECK = {
682681
on_attach = { ["function"] = true, string = true },
683682
sort_by = { ["function"] = true, string = true },
684683
root_folder_label = { ["function"] = true, string = true },
684+
picker = { ["function"] = true, string = true },
685685
}
686686

687687
local function validate_options(conf)

lua/nvim-tree/actions/node/open-file.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ local function get_target_winid(mode, win_ids)
175175
end
176176
else
177177
-- pick a window
178-
if M.window_picker.custom_function then
179-
target_winid = M.window_picker.custom_function()
178+
if M.window_picker.picker then
179+
target_winid = M.window_picker.picker()
180180
else
181181
target_winid = pick_win_id()
182182
end

0 commit comments

Comments
 (0)