aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_meta/vimfn.lua
diff options
context:
space:
mode:
authorYochem van Rosmalen <git@yochem.nl>2025-06-29 17:19:10 +0200
committerGitHub <noreply@github.com>2025-06-29 10:19:10 -0500
commitf7c939fa7af9744bcb6d79100a7e126f7e9c8f5c (patch)
tree9e093432a76e557973923009ad7a64251384d0a6 /runtime/lua/vim/_meta/vimfn.lua
parent2f95abddfaf8921555a7e252fc77ed26cbb4de5c (diff)
downloadrneovim-f7c939fa7af9744bcb6d79100a7e126f7e9c8f5c.tar.gz
rneovim-f7c939fa7af9744bcb6d79100a7e126f7e9c8f5c.tar.bz2
rneovim-f7c939fa7af9744bcb6d79100a7e126f7e9c8f5c.zip
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()`.
Diffstat (limited to 'runtime/lua/vim/_meta/vimfn.lua')
-rw-r--r--runtime/lua/vim/_meta/vimfn.lua3
1 files changed, 2 insertions, 1 deletions
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
--- <SID> "<SNR>123_" where "123" is the
--- current script ID |<SID>|
--- <script> sourced script file, or script file
---- where the current function was defined
+--- where the current function was defined.
+--- Use |debug.getinfo()| in Lua scripts.
--- <stack> call stack
--- <cword> word under the cursor
--- <cWORD> WORD under the cursor