refactor: check active picker

This commit is contained in:
Folke Lemaitre 2024-06-12 23:10:16 +02:00
parent 3b0810c003
commit f608564517
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 16 additions and 17 deletions

View file

@ -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 {