Add nil guard to lazy.load and custom mini.diff mappings
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7c5529c400
commit
61f2c89362
@ -7,8 +7,10 @@ M.load = function(name, fn)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
M._loaded[name] = true
|
M._loaded[name] = true
|
||||||
|
if fn then
|
||||||
fn()
|
fn()
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
M.on_event = function(name, event, pattern, fn)
|
M.on_event = function(name, event, pattern, fn)
|
||||||
vim.api.nvim_create_autocmd(event, {
|
vim.api.nvim_create_autocmd(event, {
|
||||||
|
|||||||
@ -128,6 +128,10 @@ end)
|
|||||||
lazy.on_event("diff", "BufReadPost", "*", function()
|
lazy.on_event("diff", "BufReadPost", "*", function()
|
||||||
require("mini.diff").setup({
|
require("mini.diff").setup({
|
||||||
source = require("mini.diff").gen_source.git({ index = false }),
|
source = require("mini.diff").gen_source.git({ index = false }),
|
||||||
|
mappings = {
|
||||||
|
apply = "gs",
|
||||||
|
textobject = "",
|
||||||
|
},
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user