From 6eb75c5678ddb4d040f644e331e222078b99b3a1 Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Sun, 15 Aug 2021 17:38:47 +0200 Subject: [Refactor] Clean-up redundant module-load checks (#1011) --- lua/core/which-key.lua | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'lua/core/which-key.lua') diff --git a/lua/core/which-key.lua b/lua/core/which-key.lua index 66e3ffbb..04f892d8 100644 --- a/lua/core/which-key.lua +++ b/lua/core/which-key.lua @@ -1,5 +1,4 @@ local M = {} -local Log = require "core.log" M.config = function() lvim.builtin.which_key = { active = false, @@ -230,14 +229,7 @@ M.config = function() end M.setup = function() - -- if not package.loaded['which-key'] then - -- return - -- end - local status_ok, which_key = pcall(require, "which-key") - if not status_ok then - Log:get_default "Failed to load whichkey" - return - end + local which_key = require "which-key" which_key.setup(lvim.builtin.which_key.setup) @@ -247,10 +239,8 @@ M.setup = function() local mappings = lvim.builtin.which_key.mappings local vmappings = lvim.builtin.which_key.vmappings - local wk = require "which-key" - - wk.register(mappings, opts) - wk.register(vmappings, vopts) + which_key.register(mappings, opts) + which_key.register(vmappings, vopts) end return M -- cgit v1.2.3