mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #15812 from bfredl/taba
fix(runtime): make a copy of runtime_search_path when iterating
This commit is contained in:
@@ -358,6 +358,12 @@ describe('startup', function()
|
||||
pack_clear [[ lua _G.test_loadorder = {} vim.cmd "packadd! superspecial\nruntime! filen.lua" ]]
|
||||
eq({'ordinary', 'SuperSpecial', 'FANCY', 'FANCY after', 'SuperSpecial after', 'ordinary after'}, exec_lua [[ return _G.test_loadorder ]])
|
||||
end)
|
||||
|
||||
it("handles the correct order with a package that changes packpath", function()
|
||||
pack_clear [[ lua _G.test_loadorder = {} vim.cmd "packadd! funky\nruntime! filen.lua" ]]
|
||||
eq({'ordinary', 'funky!', 'FANCY', 'FANCY after', 'ordinary after'}, exec_lua [[ return _G.test_loadorder ]])
|
||||
eq({'ordinary', 'funky!', 'ordinary after'}, exec_lua [[ return _G.nested_order ]])
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('sysinit', function()
|
||||
|
||||
12
test/functional/fixtures/pack/foo/opt/funky/filen.lua
Normal file
12
test/functional/fixtures/pack/foo/opt/funky/filen.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
table.insert(_G.test_loadorder, "funky!")
|
||||
|
||||
if not _G.nesty then
|
||||
_G.nesty = true
|
||||
local save_order = _G.test_loadorder
|
||||
_G.test_loadorder = {}
|
||||
_G.vim.o.pp = "" -- funky!
|
||||
vim.cmd [[runtime! filen.lua ]]
|
||||
_G.nested_order = _G.test_loadorder
|
||||
_G.test_loadorder = save_order
|
||||
_G.nesty = nil
|
||||
end
|
||||
Reference in New Issue
Block a user