fix(exrc): exrc knows its own location (#34638)

fix(exrc): lua exrc files know their location

Problem:
'exrc' files are inherently bound to their location / workspace and
therefore require to "know" their location on the filesystem. However,
currently using `debug.getinfo(1, 'S')` returns `"<nvim>"`.

Solution:
Include the filepath as chunkname in `loadstring()` and `nlua_exec()`.
This commit is contained in:
Yochem van Rosmalen
2025-06-29 17:19:10 +02:00
committed by GitHub
parent 2f95abddfa
commit f7c939fa7a
12 changed files with 24 additions and 11 deletions

View File

@@ -513,7 +513,7 @@ Object nvim_exec_lua(String code, Array args, Arena *arena, Error *err)
FUNC_API_REMOTE_ONLY
{
// TODO(bfredl): convert directly from msgpack to lua and then back again
return nlua_exec(code, args, kRetObject, arena, err);
return nlua_exec(code, NULL, args, kRetObject, arena, err);
}
/// Calculates the number of display cells occupied by `text`.