summaryrefslogtreecommitdiffstatshomepage
path: root/src/gen/preload_nlua.lua
blob: 89809847381a867adb3a0c5497c92125342e5dea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
local srcdir = table.remove(arg, 1)
local nlualib = table.remove(arg, 1)
local gendir = table.remove(arg, 1)

package.path = (srcdir .. '/src/?.lua;')
  .. (srcdir .. '/runtime/lua/?.lua;')
  .. (gendir .. '/?.lua;')
  .. package.path

_G.vim = require 'vim._core.shared'
_G.vim.inspect = require 'vim.inspect'
_G.vim.iter = require 'vim.iter'
package.cpath = package.cpath .. ';' .. nlualib
require 'nlua0'
vim.NIL = vim.mpack.NIL -- WOW BOB WOW

arg[0] = table.remove(arg, 1)
return loadfile(arg[0])()