Skip to content

Commit

Permalink
fix: Safe handling of config option #84
Browse files Browse the repository at this point in the history
  • Loading branch information
Allaman committed May 19, 2024
1 parent dec9513 commit 790685e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/utils/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ end

-- Return file browser command
M.file_browser = function()
if vim.g.config.plugins.yazi.enabled then
if M.safe_nested_config(vim.g.config.plugins, "yazi", "enabled") then
return "<cmd>lua require('yazi').yazi(nil, vim.fn.getcwd())<cr>"
end
if vim.g.config.plugins.lf.enable then
if M.safe_nested_config(vim.g.config.plugins, "lf", "enable") then
return "<cmd>Lf<cr>"
end
return "<cmd>Telescope file_browser grouped=true<cr>"
Expand Down

0 comments on commit 790685e

Please sign in to comment.