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()`. --- runtime/lua/vim/_meta/vimfn.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/lua/vim/_meta/vimfn.lua') diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index 797c33de33..5150ddedce 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -1871,7 +1871,8 @@ function vim.fn.exp(expr) end --- "123_" where "123" is the --- current script ID || ---