Skip to content

Commit e442bb2

Browse files
committed
fix(keymaps): resume precompile module path is possible
1 parent 83f7195 commit e442bb2

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lua/fzf-lua/path.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,12 @@ function M.keymap_to_entry(str)
685685
if vmap.callback then
686686
local info = debug.getinfo(vmap.callback)
687687
if info and info.source then
688-
return { path = info.source:gsub("^@", ""), line = info.linedefined }
688+
local source = info.source:gsub("^@", "")
689+
-- https://github.com/neovim/neovim/blob/64d55b74d83d566975e269bed0810d9008119ddf/src/nvim/lua/executor.c#L671-L680
690+
if source:match("vim/") and package.preload[source:gsub("%.lua$", ""):gsub("/", ".")] then
691+
source = vim.env.VIMRUNTIME .. "/lua/" .. source
692+
end
693+
return { path = source, line = info.linedefined }
689694
end
690695
end
691696
local cmd = ("verb %smap %s"):format(mode, keymap)

0 commit comments

Comments
 (0)