From 61f2c89362109579f31e8d5bd3cd2b7ef7e32e84 Mon Sep 17 00:00:00 2001 From: xfy Date: Thu, 28 May 2026 11:43:06 +0800 Subject: [PATCH] Add nil guard to lazy.load and custom mini.diff mappings Co-Authored-By: Claude Opus 4.7 (1M context) --- lua/lazy.lua | 4 +++- lua/pack.lua | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/lazy.lua b/lua/lazy.lua index 24cf69d..016f831 100644 --- a/lua/lazy.lua +++ b/lua/lazy.lua @@ -7,7 +7,9 @@ M.load = function(name, fn) return end M._loaded[name] = true - fn() + if fn then + fn() + end end M.on_event = function(name, event, pattern, fn) diff --git a/lua/pack.lua b/lua/pack.lua index a31bb7d..41f32ce 100644 --- a/lua/pack.lua +++ b/lua/pack.lua @@ -128,6 +128,10 @@ end) lazy.on_event("diff", "BufReadPost", "*", function() require("mini.diff").setup({ source = require("mini.diff").gen_source.git({ index = false }), + mappings = { + apply = "gs", + textobject = "", + }, }) end)