aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_core
diff options
context:
space:
mode:
author€šm̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰�Ř§Ů Â£╟©舐æØ¢£ðsÞ¥¿— <memchr@proton.me>2025-12-09 03:22:10 +0000
committerGitHub <noreply@github.com>2025-12-08 22:22:10 -0500
commited9abb1851e31b98b79b1b06eef5ceeccdbb7372 (patch)
tree3f07a63e1f13ab5b8e99584c0a9f09437f0410c8 /runtime/lua/vim/_core
parent2f9f77cd722a9dad71df46f39c71dca88815c290 (diff)
downloadrneovim-ed9abb1851e31b98b79b1b06eef5ceeccdbb7372.tar.gz
rneovim-ed9abb1851e31b98b79b1b06eef5ceeccdbb7372.tar.bz2
rneovim-ed9abb1851e31b98b79b1b06eef5ceeccdbb7372.zip
fix(exrc): ensure consistent 'exrc' loading sequence #35148
Problem: The execution of startup scripts in parent directories are too late compared to scripts in current direcctory. Solution: Execute all startup scripts with `lua/_core/exrc.lua`. closes: #35147
Diffstat (limited to 'runtime/lua/vim/_core')
-rw-r--r--runtime/lua/vim/_core/exrc.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/runtime/lua/vim/_core/exrc.lua b/runtime/lua/vim/_core/exrc.lua
new file mode 100644
index 0000000000..2fa586933b
--- /dev/null
+++ b/runtime/lua/vim/_core/exrc.lua
@@ -0,0 +1,19 @@
+local files = vim.fs.find({ '.nvim.lua', '.nvimrc', '.exrc' }, {
+ type = 'file',
+ upward = true,
+ limit = math.huge,
+})
+for _, file in ipairs(files) do
+ local trusted = vim.secure.read(file) --[[@as string|nil]]
+ if trusted then
+ if vim.endswith(file, '.lua') then
+ assert(loadstring(trusted, '@' .. file))()
+ else
+ vim.api.nvim_exec2(trusted, {})
+ end
+ end
+ -- If the user unset 'exrc' in the current exrc then stop searching
+ if not vim.o.exrc then
+ break
+ end
+end