Skip to content

Commit 9c60947

Browse files
authored
fix(#2175): check number of actions.open_file.window_picker.chars before picking window (#2177)
1 parent d8b154c commit 9c60947

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
-- Copyright 2019 Yazdani Kiyan under MIT License
22
local lib = require "nvim-tree.lib"
3+
local notify = require "nvim-tree.notify"
34
local utils = require "nvim-tree.utils"
45
local view = require "nvim-tree.view"
56

@@ -60,6 +61,17 @@ local function pick_win_id()
6061
return selectable[1]
6162
end
6263

64+
if #M.window_picker.chars < #selectable then
65+
notify.error(
66+
string.format(
67+
"More windows (%d) than actions.open_file.window_picker.chars (%d) - please add more.",
68+
#selectable,
69+
#M.window_picker.chars
70+
)
71+
)
72+
return nil
73+
end
74+
6375
local i = 1
6476
local win_opts = {}
6577
local win_map = {}

0 commit comments

Comments
 (0)