diff --git a/lua/lazyvim/plugins/extras/coding/yanky.lua b/lua/lazyvim/plugins/extras/coding/yanky.lua index 8f9efdb6..02b3b18a 100644 --- a/lua/lazyvim/plugins/extras/coding/yanky.lua +++ b/lua/lazyvim/plugins/extras/coding/yanky.lua @@ -11,9 +11,8 @@ return { { "p", function() - local ok, telescope = pcall(require, "telescope") - if ok then - telescope.extensions.yank_history.yank_history({}) + if LazyVim.pick.picker.name == "telescope" then + require("telescope").extensions.yank_history.yank_history({}) else vim.cmd([[YankyRingHistory]]) end diff --git a/lua/lazyvim/plugins/extras/util/project.lua b/lua/lazyvim/plugins/extras/util/project.lua index fc74929b..8f8d65ca 100644 --- a/lua/lazyvim/plugins/extras/util/project.lua +++ b/lua/lazyvim/plugins/extras/util/project.lua @@ -1,20 +1,20 @@ local pick = function() - if pcall(require, "telescope") then + if LazyVim.pick.picker.name == "telescope" then return vim.cmd("Telescope projects") - end - - local fzf_lua = require("fzf-lua") - local history = require("project_nvim.utils.history") - local results = history.get_recent_projects() - fzf_lua.fzf_exec(results, { - actions = { - ["default"] = { - function(selected) - fzf_lua.files({ cwd = selected[1] }) - end, + elseif LazyVim.pick.picker.name == "fzf" then + local fzf_lua = require("fzf-lua") + local history = require("project_nvim.utils.history") + local results = history.get_recent_projects() + fzf_lua.fzf_exec(results, { + actions = { + ["default"] = { + function(selected) + fzf_lua.files({ cwd = selected[1] }) + end, + }, }, - }, - }) + }) + end end return {