diff options
author | Christian Clason <c.clason@uni-graz.at> | 2022-05-09 11:23:51 +0200 |
---|---|---|
committer | Christian Clason <c.clason@uni-graz.at> | 2022-05-09 16:31:55 +0200 |
commit | aefdc6783cb77f09786542c90901a9e7120bea42 (patch) | |
tree | ddce6de8f084ab96270f6111d8e423d0b1533171 /runtime/lua/vim/_init_packages.lua | |
parent | 676e9e9334043ce74af74f85f889b0327a443d0b (diff) | |
download | rneovim-aefdc6783cb77f09786542c90901a9e7120bea42.tar.gz rneovim-aefdc6783cb77f09786542c90901a9e7120bea42.tar.bz2 rneovim-aefdc6783cb77f09786542c90901a9e7120bea42.zip |
chore: format runtime with stylua
Diffstat (limited to 'runtime/lua/vim/_init_packages.lua')
-rw-r--r-- | runtime/lua/vim/_init_packages.lua | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/runtime/lua/vim/_init_packages.lua b/runtime/lua/vim/_init_packages.lua index 7d27741f1b..7e3c73667e 100644 --- a/runtime/lua/vim/_init_packages.lua +++ b/runtime/lua/vim/_init_packages.lua @@ -3,8 +3,8 @@ local vim = assert(vim) local pathtrails = {} vim._so_trails = {} -for s in (package.cpath..';'):gmatch('[^;]*;') do - s = s:sub(1, -2) -- Strip trailing semicolon +for s in (package.cpath .. ';'):gmatch('[^;]*;') do + s = s:sub(1, -2) -- Strip trailing semicolon -- Find out path patterns. pathtrail should contain something like -- /?.so, \?.dll. This allows not to bother determining what correct -- suffixes are. @@ -17,29 +17,29 @@ end function vim._load_package(name) local basename = name:gsub('%.', '/') - local paths = {"lua/"..basename..".lua", "lua/"..basename.."/init.lua"} - local found = vim.api.nvim__get_runtime(paths, false, {is_lua=true}) + local paths = { 'lua/' .. basename .. '.lua', 'lua/' .. basename .. '/init.lua' } + local found = vim.api.nvim__get_runtime(paths, false, { is_lua = true }) if #found > 0 then local f, err = loadfile(found[1]) return f or error(err) end local so_paths = {} - for _,trail in ipairs(vim._so_trails) do - local path = "lua"..trail:gsub('?', basename) -- so_trails contains a leading slash + for _, trail in ipairs(vim._so_trails) do + local path = 'lua' .. trail:gsub('?', basename) -- so_trails contains a leading slash table.insert(so_paths, path) end - found = vim.api.nvim__get_runtime(so_paths, false, {is_lua=true}) + found = vim.api.nvim__get_runtime(so_paths, false, { is_lua = true }) if #found > 0 then -- Making function name in Lua 5.1 (see src/loadlib.c:mkfuncname) is -- a) strip prefix up to and including the first dash, if any -- b) replace all dots by underscores -- c) prepend "luaopen_" -- So "foo-bar.baz" should result in "luaopen_bar_baz" - local dash = name:find("-", 1, true) + local dash = name:find('-', 1, true) local modname = dash and name:sub(dash + 1) or name - local f, err = package.loadlib(found[1], "luaopen_"..modname:gsub("%.", "_")) + local f, err = package.loadlib(found[1], 'luaopen_' .. modname:gsub('%.', '_')) return f or error(err) end return nil @@ -49,15 +49,15 @@ end table.insert(package.loaders, 2, vim._load_package) -- builtin functions which always should be available -require'vim.shared' +require('vim.shared') -vim._submodules = {inspect=true} +vim._submodules = { inspect = true } -- These are for loading runtime modules in the vim namespace lazily. setmetatable(vim, { __index = function(t, key) if vim._submodules[key] then - t[key] = require('vim.'..key) + t[key] = require('vim.' .. key) return t[key] elseif vim.startswith(key, 'uri_') then local val = require('vim.uri')[key] @@ -67,7 +67,7 @@ setmetatable(vim, { return t[key] end end - end + end, }) --- <Docs described in |vim.empty_dict()| > @@ -79,5 +79,5 @@ end -- only on main thread: functions for interacting with editor state if not vim.is_thread() then - require'vim._editor' + require('vim._editor') end |