From 9acadc7ec289966cf8f4f6c37c348f286ed73ffe Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 4 Jul 2024 15:21:02 +0200 Subject: [PATCH] fix(fzf): make sure `vim.ui.select` works when fzf is not loaded yet --- lua/lazyvim/plugins/extras/editor/fzf.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index e9b19496..67acc830 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -192,6 +192,14 @@ return { require("fzf-lua").setup(opts) require("fzf-lua").register_ui_select(opts.ui_select or nil) end, + init = function() + LazyVim.on_very_lazy(function() + vim.ui.select = function(...) + require("fzf-lua") + return vim.ui.select(...) + end + end) + end, keys = { { "", "", ft = "fzf", mode = "t", nowait = true }, { "", "", ft = "fzf", mode = "t", nowait = true },