ref(libmodal): `mode.switch` -> `mode.map.switch`

pull/36/head
Iron-E 2 months ago
parent 9fa22b0453
commit 974c40cfc6
No known key found for this signature in database
GPG Key ID: 569E791B76A42A1A

@ -53,11 +53,27 @@ function libmodal.mode.enter(name, instruction, supress_exit)
mode:enter()
end
--- @see libmodal.mode.map.switch
function libmodal.mode.switch(...)
vim.deprecate('libmodal.mode.switch', 'libmodal.mode.map.switch', '4.0.0', 'nvim-libmodal')
return libmodal.mode.map.switch(...)
end
libmodal.mode.map = {}
--- `enter` a mode using the arguments given, and do not return to the current mode.
---
--- Example:
--- ```lua
--- {
--- a = switch('foo', {--[[Foo mode keymaps go here]]}),
--- }
--- ```
---
--- @param ... unknown arguments to `libmodal.mode.enter`
--- @return fun(self: libmodal.Mode) switcher enters the mode
--- @see libmodal.mode.enter which this function takes the same arguments as
function libmodal.mode.switch(...)
function libmodal.mode.map.switch(...)
local args = { ... }
return function(self)
self:switch(unpack(args))

Loading…
Cancel
Save