fix(map_util): add `<CR>` after string bindings
If you have two <Plug> bindings, one that's a prefix to another: - <Plug>MyScript:Cmd - <Plug>MyScript:Cmd2 If you try and use the prefix binding, vim will wait for `ttimeoutlen` Co-authored-by: Oliver Marshall <olivershawmarshall@gmail.com>
This commit is contained in:
parent
26fb642ff3
commit
114ed132a3
|
@ -37,7 +37,9 @@ M.create_maps_to_plug = function(bufnr, mode, bindings, prefix)
|
||||||
-- Prefix with <Plug> unless this is a <Cmd> or :Cmd mapping
|
-- Prefix with <Plug> unless this is a <Cmd> or :Cmd mapping
|
||||||
if type(rhs) == "string" then
|
if type(rhs) == "string" then
|
||||||
if not rhs:match("[<:]") then
|
if not rhs:match("[<:]") then
|
||||||
rhs = "<Plug>" .. prefix .. rhs
|
rhs = "<Plug>" .. prefix .. rhs .. "<CR>"
|
||||||
|
else
|
||||||
|
rhs = rhs .. "<CR>"
|
||||||
end
|
end
|
||||||
if mode == "i" then
|
if mode == "i" then
|
||||||
rhs = "<C-o>" .. rhs
|
rhs = "<C-o>" .. rhs
|
||||||
|
|
Loading…
Reference in New Issue