diff options
author | kylo252 <[email protected]> | 2022-10-04 19:23:52 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2022-10-04 13:23:52 -0400 |
commit | e5bcf01c759e7c833d8a5f1fcf665b6ea32a7c16 (patch) | |
tree | 51b68c8face9faa2a41fcc8103b6296213557d4b /lua/lvim/core/lir.lua | |
parent | 560ee4d7cf4038a22a5556d79ad92cd226a792dc (diff) |
refactor: more deliberate reload (#3133)
Diffstat (limited to 'lua/lvim/core/lir.lua')
-rw-r--r-- | lua/lvim/core/lir.lua | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/lua/lvim/core/lir.lua b/lua/lvim/core/lir.lua index af9eb549..68445664 100644 --- a/lua/lvim/core/lir.lua +++ b/lua/lvim/core/lir.lua @@ -7,16 +7,16 @@ M.config = function() icon = "î—¿", } - local status_ok, lir = pcall(reload, "lir") + local status_ok, _ = pcall(require, "lir") if not status_ok then return end - local actions = reload "lir.actions" - local mark_actions = reload "lir.mark.actions" - local clipboard_actions = reload "lir.clipboard.actions" + local actions = require "lir.actions" + local mark_actions = require "lir.mark.actions" + local clipboard_actions = require "lir.clipboard.actions" - lir.setup { + lvim.builtin.lir = vim.tbl_extend("force", lvim.builtin.lir, { show_hidden_files = false, devicons_enable = true, mappings = { @@ -80,16 +80,7 @@ M.config = function() -- echo cwd -- vim.api.nvim_echo({ { vim.fn.expand "%:p", "Normal" } }, false, {}) end, - } - - -- custom folder icon - reload("nvim-web-devicons").set_icon { - lir_folder_icon = { - icon = lvim.icons.ui.Folder, - color = "#42A5F5", - name = "LirFolderNode", - }, - } + }) end function M.icon_setup() @@ -113,14 +104,11 @@ function M.icon_setup() end function M.setup() - if lvim.builtin.nvimtree.active then - return - end - local status_ok, lir = pcall(reload, "lir") if not status_ok then return end + lir.setup(lvim.builtin.lir) if lvim.builtin.lir.on_config_done then lvim.builtin.lir.on_config_done(lir) |