feat(loader): warn when maplocalleader is changed after init (#1326)

* feat(loader): warn when maplocalleader is changed after init

* docs: default maplocalleader

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
This commit is contained in:
TheSast 2024-03-07 16:32:07 +00:00 committed by GitHub
parent c96fc24555
commit 0694651fd3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 14 additions and 1 deletions

View file

@ -199,6 +199,9 @@ M.me = nil
---@type string
M.mapleader = nil
---@type string
M.maplocalleader = nil
function M.headless()
return #vim.api.nvim_list_uis() == 0
end
@ -245,6 +248,7 @@ function M.setup(opts)
-- disable plugin loading since we do all of that ourselves
vim.go.loadplugins = false
M.mapleader = vim.g.mapleader
M.maplocalleader = vim.g.maplocalleader
if M.headless() then
require("lazy.view.commands").setup()

View file

@ -50,6 +50,7 @@ function M.setup()
Util.track()
end
Config.mapleader = vim.g.mapleader
Config.maplocalleader = vim.g.maplocalleader
-- report any warnings & errors
Config.spec:report()