diff options
| author | phanium <91544758+phanen@users.noreply.github.com> | 2026-04-24 00:42:41 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-23 12:42:41 -0400 |
| commit | 398f2c108d8ee3ce7ac950b60520a9569b63da67 (patch) | |
| tree | 3dc395da55fa0d741628325280ed89a2fa7b41e1 /test/functional/vimscript/executable_spec.lua | |
| parent | 790a8be5f306a28ca8e96c2ae3fa3b465ae3718f (diff) | |
fix(lua): don't strip debuginfo in precompile module #39191
Problem:
debug.getinfo on bytecode module/func don't give you detail source info.
Solution:
- Use `loadstring`+`string.dump` to replace LUAC_PRG(`luac`/`luajit -b`)
- `string.dump(…,false)` to generate non-strip version bytecode
- `loadstring(…,fname)` to specify the full source name
BEFORE:
$ nvim --clean +'=debug.getinfo(vim.fn.maparg("]<Space>", "n", 0, 1).callback, "Sl")' --headless +q
{
currentline = -1,
lastlinedefined = 456,
linedefined = 452,
short_src = "?",
source = "=?",
what = "Lua"
}
AFTER:
$ nvim --clean +'=debug.getinfo(vim.fn.maparg("]<Space>", "n", 0, 1).callback, "Sl")' --headless +q
{
currentline = -1,
lastlinedefined = 456,
linedefined = 452,
short_src = "/home/xx/b/neovim/runtime/lua/vim/_core/defaults.lua",
source = "@/home/xx/b/neovim/runtime/lua/vim/_core/defaults.lua",
what = "Lua"
}
Diffstat (limited to 'test/functional/vimscript/executable_spec.lua')
0 files changed, 0 insertions, 0 deletions
