mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +00:00
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:

committed by
GitHub

parent
2f95abddfa
commit
f7c939fa7a
2
runtime/lua/vim/_meta/options.lua
generated
2
runtime/lua/vim/_meta/options.lua
generated
@@ -2194,6 +2194,8 @@ vim.bo.et = vim.bo.expandtab
|
||||
--- Unset 'exrc' to stop further searching of 'exrc' files in parent
|
||||
--- directories, similar to `editorconfig.root`.
|
||||
---
|
||||
--- To get its own location, Lua exrc files can use `debug.getinfo()`.
|
||||
---
|
||||
--- Compare 'exrc' to `editorconfig`:
|
||||
--- - 'exrc' can execute any code; editorconfig only specifies settings.
|
||||
--- - 'exrc' is Nvim-specific; editorconfig works in other editors.
|
||||
|
Reference in New Issue
Block a user