refactor: undeprecate fzf-lua config (#97)
Instead of encouraging people to register fzf-lua ui_select manually, we can just call into it. I found a way to pass in config options (which was the sticking point previously). Doing it this way preserves the rest of the dressing functionality (e.g. get_config)
This commit is contained in:
parent
540d6e7115
commit
bf1a554644
|
@ -88,6 +88,14 @@ local default_config = {
|
|||
},
|
||||
},
|
||||
|
||||
-- Options for fzf-lua
|
||||
fzf_lua = {
|
||||
-- winopts = {
|
||||
-- height = 0.5,
|
||||
-- width = 0.5,
|
||||
-- },
|
||||
},
|
||||
|
||||
-- Options for nui Menu
|
||||
nui = {
|
||||
position = "50%",
|
||||
|
|
|
@ -5,13 +5,13 @@ M.is_supported = function()
|
|||
end
|
||||
|
||||
M.select = function(config, items, opts, on_choice)
|
||||
if config then
|
||||
vim.notify_once(
|
||||
"Deprecated: dressing config for fzf_lua has been removed in favor of using the built-in fzf-lua vim.ui.select implementation.\nRemove the fzf_lua key from dressing.setup()",
|
||||
vim.log.levels.WARN
|
||||
)
|
||||
local ui_select = require("fzf-lua.providers.ui_select")
|
||||
if config and not vim.tbl_isempty(config) then
|
||||
-- Registering then unregistering sets the config options
|
||||
ui_select.register(config, true)
|
||||
ui_select.deregister(nil, true, true)
|
||||
end
|
||||
return require("fzf-lua.providers.ui_select").ui_select(items, opts, on_choice)
|
||||
return ui_select.ui_select(items, opts, on_choice)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
Loading…
Reference in New Issue