From 28f1511e0a19d41f9c5e53a64ece257449681b4d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 22 Dec 2022 09:12:06 +0100 Subject: [PATCH] fix: show mapleader warning with vim.schedule. Fixes #91 --- lua/lazy/manage/reloader.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazy/manage/reloader.lua b/lua/lazy/manage/reloader.lua index 882327a..23c8863 100644 --- a/lua/lazy/manage/reloader.lua +++ b/lua/lazy/manage/reloader.lua @@ -65,7 +65,9 @@ function M.check(start) 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") + vim.schedule(function() + require("lazy.core.util").warn("You need to set `vim.g.mapleader` **BEFORE** loading lazy") + end) Config.mapleader = vim.g.mapleader end