Skip to content

Commit

Permalink
fix(lir): nil check, simpler logic (LunarVim#3725)
Browse files Browse the repository at this point in the history
* fix(lir): nil check

* simpler logic
  • Loading branch information
LostNeophyte committed Jan 13, 2023
1 parent 3115088 commit 2922a42
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions lua/lvim/core/lir.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ M.config = function()
end

function M.icon_setup()
if not lvim.builtin.lir.devicons.enable then
local devicons_ok, devicons = pcall(require, "nvim-web-devicons")
if not devicons_ok then
return
end

Expand All @@ -97,16 +98,13 @@ function M.icon_setup()
icon_hl = "#42A5F5"
end

local devicons_ok, devicons = pcall(require, "nvim-web-devicons")
if devicons_ok then
devicons.set_icon {
lir_folder_icon = {
icon = lvim.builtin.lir.icon,
color = icon_hl,
name = "LirFolderNode",
},
}
end
devicons.set_icon {
lir_folder_icon = {
icon = lvim.builtin.lir.icon,
color = icon_hl,
name = "LirFolderNode",
},
}
end

function M.setup()
Expand Down

0 comments on commit 2922a42

Please sign in to comment.