summaryrefslogtreecommitdiff
path: root/lua/core/which-key.lua
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2021-08-15 17:38:47 +0200
committerGitHub <[email protected]>2021-08-15 20:08:47 +0430
commit6eb75c5678ddb4d040f644e331e222078b99b3a1 (patch)
tree9830028d434cb9cc4e830346fc40ce392db29721 /lua/core/which-key.lua
parentf36fd1907fd2480c766d96c65e1aebe69e5c855f (diff)
[Refactor] Clean-up redundant module-load checks (#1011)
Diffstat (limited to 'lua/core/which-key.lua')
-rw-r--r--lua/core/which-key.lua16
1 files changed, 3 insertions, 13 deletions
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