From f7c939fa7af9744bcb6d79100a7e126f7e9c8f5c Mon Sep 17 00:00:00 2001 From: Yochem van Rosmalen Date: Sun, 29 Jun 2025 17:19:10 +0200 Subject: 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 `""`. Solution: Include the filepath as chunkname in `loadstring()` and `nlua_exec()`. --- src/nvim/lua/executor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/lua/executor.h') diff --git a/src/nvim/lua/executor.h b/src/nvim/lua/executor.h index 557c0b025e..77cd30246d 100644 --- a/src/nvim/lua/executor.h +++ b/src/nvim/lua/executor.h @@ -26,7 +26,7 @@ typedef struct { } nlua_ref_state_t; #define NLUA_EXEC_STATIC(cstr, arg, mode, arena, err) \ - nlua_exec(STATIC_CSTR_AS_STRING(cstr), arg, mode, arena, err) + nlua_exec(STATIC_CSTR_AS_STRING(cstr), NULL, arg, mode, arena, err) #define NLUA_CLEAR_REF(x) \ do { \ -- cgit