Use instead of

This commit is contained in:
hrsh7th
2021-10-11 00:43:14 +09:00
parent 67d43ddd59
commit d8e6a865e4
5 changed files with 20 additions and 7 deletions

View File

@@ -72,6 +72,20 @@ keymap.to_keymap = function(s)
end)
end
---Create backspace keys.
---@param count number
---@return string
keymap.backspace = function(count)
if count <= 0 then
return ''
end
local keys = {}
table.insert(keys, keymap.t('<C-g>U'))
table.insert(keys, keymap.t(string.rep('<Left>', count)))
table.insert(keys, keymap.t(string.rep('<Del>', count)))
return table.concat(keys, '')
end
---Return two key sequence are equal or not.
---@param a string
---@param b string