Replies: 1 comment 1 reply
-
The returned value of A more idiomatic approach to this would be to define custom function FileSelector:mini_pick_ui(handler)
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
end
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 }
local result = MiniPick.builtin.files(nil, { source = source })
if result == nil then handler(nil) end
end |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Contributing guidelines
Module(s)
mini.pick
Question
I added mini.pick to the file selectors for avante.nvim. However, it seems it was broken in this PR. I have fixed that by updating the code to:
This works, and I believe it would work with multi select, but when I select multiple with
<c-x>
then use<m-cr>
, the function only returns current, but the selections are opened in quickfix.How can I actually return selected files?
Beta Was this translation helpful? Give feedback.
All reactions