mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-23 01:08:59 +02:00
refactor: check active picker
This commit is contained in:
parent
3b0810c003
commit
f608564517
2 changed files with 16 additions and 17 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue