diff --git a/lua/nvim-tree/actions/node/open-file.lua b/lua/nvim-tree/actions/node/open-file.lua index 00908576..6990c896 100644 --- a/lua/nvim-tree/actions/node/open-file.lua +++ b/lua/nvim-tree/actions/node/open-file.lua @@ -1,5 +1,6 @@ -- Copyright 2019 Yazdani Kiyan under MIT License local lib = require "nvim-tree.lib" +local notify = require "nvim-tree.notify" local utils = require "nvim-tree.utils" local view = require "nvim-tree.view" @@ -60,6 +61,17 @@ local function pick_win_id() return selectable[1] end + if #M.window_picker.chars < #selectable then + notify.error( + string.format( + "More windows (%d) than actions.open_file.window_picker.chars (%d) - please add more.", + #selectable, + #M.window_picker.chars + ) + ) + return nil + end + local i = 1 local win_opts = {} local win_map = {}