feat(loader): warn when mapleader is changed after init

This commit is contained in:
Folke Lemaitre 2022-12-21 10:51:31 +01:00
parent 540847b7cb
commit 4ca30390ec
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 10 additions and 0 deletions

View file

@ -2,6 +2,7 @@ local Cache = require("lazy.core.cache")
local Config = require("lazy.core.config")
local Util = require("lazy.util")
local Plugin = require("lazy.core.plugin")
local Loader = require("lazy.core.loader")
local M = {}
@ -63,6 +64,11 @@ function M.check(start)
end
end
if Loader.init_done and Config.mapleader ~= vim.g.mapleader then
require("lazy.core.util").warn("You need to set `vim.g.mapleader` **BEFORE** loading lazy")
Config.mapleader = vim.g.mapleader
end
if not (start or #changes == 0) then
vim.schedule(function()
if Config.options.change_detection.notify then