Merge pull request #15812 from bfredl/taba

fix(runtime): make a copy of runtime_search_path when iterating
This commit is contained in:
Björn Linse
2021-09-28 19:12:39 +02:00
committed by GitHub
4 changed files with 60 additions and 16 deletions

View File

@@ -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()

View 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