fix: move telescope.actions pcall to the top

This commit is contained in:
Opal Mizrahi 2022-10-09 01:48:59 +03:00
parent 53fb663efe
commit 3d36b20de2

View file

@ -1,5 +1,10 @@
local M = {} local M = {}
local ok, actions = pcall(require, "telescope.actions")
if not ok then
return
end
local pickers = { local pickers = {
find_files = { find_files = {
theme = "dropdown", theme = "dropdown",
@ -21,10 +26,10 @@ local pickers = {
initial_mode = "normal", initial_mode = "normal",
mappings = { mappings = {
i = { i = {
["<C-d>"] = require("telescope.actions").delete_buffer, ["<C-d>"] = actions.delete_buffer,
}, },
n = { n = {
["dd"] = require("telescope.actions").delete_buffer, ["dd"] = actions.delete_buffer,
}, },
}, },
}, },
@ -65,10 +70,6 @@ function M.config()
on_config_done = nil, on_config_done = nil,
} }
local ok, actions = pcall(require, "telescope.actions")
if not ok then
return
end
lvim.builtin.telescope = vim.tbl_extend("force", lvim.builtin.telescope, { lvim.builtin.telescope = vim.tbl_extend("force", lvim.builtin.telescope, {
defaults = { defaults = {
prompt_prefix = lvim.icons.ui.Telescope .. " ", prompt_prefix = lvim.icons.ui.Telescope .. " ",