mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-28 03:30:12 +02:00
fix(pick): allow configuring pickers without LazyExtras. Fixes #3626
This commit is contained in:
parent
c9380a309d
commit
304e7439aa
5 changed files with 42 additions and 2 deletions
|
@ -32,6 +32,11 @@ function M.register(picker)
|
|||
if vim.v.vim_did_enter == 1 then
|
||||
return true
|
||||
end
|
||||
|
||||
if M.picker and M.picker.name ~= M.want() then
|
||||
M.picker = nil
|
||||
end
|
||||
|
||||
if M.picker and M.picker.name ~= picker.name then
|
||||
LazyVim.warn(
|
||||
"`LazyVim.pick`: picker already set to `" .. M.picker.name .. "`,\nignoring new picker `" .. picker.name .. "`"
|
||||
|
@ -42,6 +47,14 @@ function M.register(picker)
|
|||
return true
|
||||
end
|
||||
|
||||
function M.want()
|
||||
vim.g.lazyvim_picker = vim.g.lazyvim_picker or "auto"
|
||||
if vim.g.lazyvim_picker == "auto" then
|
||||
return LazyVim.has_extra("editor.fzf") and "fzf" or "telescope"
|
||||
end
|
||||
return vim.g.lazyvim_picker
|
||||
end
|
||||
|
||||
---@param command? string
|
||||
---@param opts? lazyvim.util.pick.Opts
|
||||
function M.open(command, opts)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue