Prechádzať zdrojové kódy

fix: pcall telescope actions

ChristianChiarulli 3 rokov pred
rodič
commit
6b3e0574a3
1 zmenil súbory, kde vykonal 5 pridanie a 1 odobranie
  1. 5 1
      lua/lvim/core/telescope.lua

+ 5 - 1
lua/lvim/core/telescope.lua

@@ -2,13 +2,17 @@ local M = {}
 
 
 function M.config()
 function M.config()
   -- Define this minimal config so that it's available if telescope is not yet available.
   -- Define this minimal config so that it's available if telescope is not yet available.
+
   lvim.builtin.telescope = {
   lvim.builtin.telescope = {
     ---@usage disable telescope completely [not recommeded]
     ---@usage disable telescope completely [not recommeded]
     active = true,
     active = true,
     on_config_done = nil,
     on_config_done = nil,
   }
   }
 
 
-  local actions = require "telescope.actions"
+  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 = " ",
       prompt_prefix = " ",