From 6c02ff474732dcc6ae5cf103c79298c9602fd116 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 14 Jan 2019 02:05:56 +0100 Subject: lua/stdlib: Load runtime modules on-demand MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of eager-loading during plugin/* sourcing, define runtime modules such as `vim.inspect` as lazy builtins. Otherwise non-builtin Lua modules such as `vim.inspect` would not be available during startup (init.vim, `-c`, `--cmd`, …). ref #6580 ref #8677 --- test/functional/lua/utility_functions_spec.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'test/functional/lua/utility_functions_spec.lua') diff --git a/test/functional/lua/utility_functions_spec.lua b/test/functional/lua/utility_functions_spec.lua index 5f511f4a43..6f327ad733 100644 --- a/test/functional/lua/utility_functions_spec.lua +++ b/test/functional/lua/utility_functions_spec.lua @@ -169,16 +169,14 @@ end) describe("vim.inspect", function() it('works', function() - command("source runtime/plugin/nvim.vim") -- just make sure it basically works, it has its own test suite local inspect = function(t, opts) return meths.execute_lua('return vim.inspect(...)', { t, opts }) end eq('2', inspect(2)) - - local i = inspect({ a = { b = 1 } }, { newline = '+', indent = '' }) - eq('{+a = {+b = 1+}+}', i) + eq('{+a = {+b = 1+}+}', + inspect({ a = { b = 1 } }, { newline = '+', indent = '' })) end) end) -- cgit