mirror of https://github.com/folke/lazy.nvim.git
feat(loader): warn when mapleader is changed after init
This commit is contained in:
parent
540847b7cb
commit
4ca30390ec
|
@ -111,6 +111,9 @@ M.options = {}
|
|||
---@type string
|
||||
M.me = nil
|
||||
|
||||
---@type string
|
||||
M.mapleader = nil
|
||||
|
||||
---@param spec LazySpec
|
||||
---@param opts? LazyConfig
|
||||
function M.setup(spec, opts)
|
||||
|
@ -143,6 +146,7 @@ function M.setup(spec, opts)
|
|||
|
||||
-- disable plugin loading since we do all of that ourselves
|
||||
vim.go.loadplugins = false
|
||||
M.mapleader = vim.g.mapleader
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "VeryLazy",
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue