mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-30 14:49:43 +02:00
[Refactor] Clean-up redundant module-load checks (#1011)
This commit is contained in:
parent
f36fd1907f
commit
6eb75c5678
8 changed files with 15 additions and 57 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue