diff options
author | Christian Clason <c.clason@uni-graz.at> | 2022-05-11 08:54:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-11 08:54:24 +0200 |
commit | cb7ab98925d6923fffcdecdc7013d33018125b14 (patch) | |
tree | fc5811e862fb40dd59b3e11412eaa956136f4916 /runtime/lua/vim/keymap.lua | |
parent | e50b1fe60d87cbe7798ce921f08ea38a4750fa99 (diff) | |
parent | aefdc6783cb77f09786542c90901a9e7120bea42 (diff) | |
download | rneovim-cb7ab98925d6923fffcdecdc7013d33018125b14.tar.gz rneovim-cb7ab98925d6923fffcdecdc7013d33018125b14.tar.bz2 rneovim-cb7ab98925d6923fffcdecdc7013d33018125b14.zip |
Merge pull request #18487 from clason/stylua
CI: format and lint runtime with Stylua
Diffstat (limited to 'runtime/lua/vim/keymap.lua')
-rw-r--r-- | runtime/lua/vim/keymap.lua | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/runtime/lua/vim/keymap.lua b/runtime/lua/vim/keymap.lua index d07232f52f..f4c2b507a9 100644 --- a/runtime/lua/vim/keymap.lua +++ b/runtime/lua/vim/keymap.lua @@ -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 |