fix: types (#1344)
This commit is contained in:
@@ -238,6 +238,7 @@ end
|
||||
|
||||
function FileSelector:mini_pick_ui(handler)
|
||||
-- luacheck: globals MiniPick
|
||||
---@diagnostic disable-next-line: undefined-field
|
||||
if not _G.MiniPick then
|
||||
Utils.error("mini.pick is not set up. Please install and set up mini.pick to use it as a file selector.")
|
||||
return
|
||||
@@ -245,11 +246,18 @@ function FileSelector:mini_pick_ui(handler)
|
||||
local choose = function(item) handler(type(item) == "string" and { item } or item) end
|
||||
local choose_marked = function(items_marked) handler(items_marked) end
|
||||
local source = { choose = choose, choose_marked = choose_marked }
|
||||
---@diagnostic disable-next-line: undefined-global
|
||||
local result = MiniPick.builtin.files(nil, { source = source })
|
||||
if result == nil then handler(nil) end
|
||||
end
|
||||
|
||||
function FileSelector:snacks_picker_ui(handler)
|
||||
---@diagnostic disable-next-line: undefined-field
|
||||
if not _G.Snacks then
|
||||
Utils.error("Snacks is not set up. Please install and set up Snacks to use it as a file selector.")
|
||||
return
|
||||
end
|
||||
---@diagnostic disable-next-line: undefined-global
|
||||
Snacks.picker.files({
|
||||
exclude = self.selected_filepaths,
|
||||
confirm = function(picker)
|
||||
|
||||
Reference in New Issue
Block a user