mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
chore: format runtime with stylua
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user