fix(lazy): 按键触发加载失败时不执行后续 action

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
xfy 2026-06-12 18:08:48 +08:00
parent 51302fe9f2
commit beb75d3a17

View File

@ -109,7 +109,9 @@ M.on_keys = function(name, keys, mode, fn, action, opts)
mode = mode or "n"
opts = opts or {}
vim.keymap.set(mode, keys, function()
M.load(name, fn)
if not M.load(name, fn) then
return
end
if action then
action()
end