chore: format runtime with stylua

This commit is contained in:
Christian Clason
2022-05-09 11:23:51 +02:00
parent 676e9e9334
commit aefdc6783c
37 changed files with 4198 additions and 3569 deletions

View File

@@ -49,20 +49,20 @@ local keymap = {}
--- Default `false`.
---@see |nvim_set_keymap()|
function keymap.set(mode, lhs, rhs, opts)
vim.validate {
mode = {mode, {'s', 't'}},
lhs = {lhs, 's'},
rhs = {rhs, {'s', 'f'}},
opts = {opts, 't', true}
}
vim.validate({
mode = { mode, { 's', 't' } },
lhs = { lhs, 's' },
rhs = { rhs, { 's', 'f' } },
opts = { opts, 't', true },
})
opts = vim.deepcopy(opts) or {}
local is_rhs_luaref = type(rhs) == "function"
mode = type(mode) == 'string' and {mode} or mode
local is_rhs_luaref = type(rhs) == 'function'
mode = type(mode) == 'string' and { mode } or mode
if is_rhs_luaref and opts.expr then
local user_rhs = rhs
rhs = function ()
rhs = function()
local res = user_rhs()
if res == nil then
-- TODO(lewis6991): Handle this in C?
@@ -118,14 +118,14 @@ end
---@see |vim.keymap.set()|
---
function keymap.del(modes, lhs, opts)
vim.validate {
mode = {modes, {'s', 't'}},
lhs = {lhs, 's'},
opts = {opts, 't', true}
}
vim.validate({
mode = { modes, { 's', 't' } },
lhs = { lhs, 's' },
opts = { opts, 't', true },
})
opts = opts or {}
modes = type(modes) == 'string' and {modes} or modes
modes = type(modes) == 'string' and { modes } or modes
local buffer = false
if opts.buffer ~= nil then