fix(builtin.commands): make 0-arg commands be repeatable by @: (#2808)

This commit is contained in:
Liu
2023-12-25 03:25:02 +08:00
committed by GitHub
parent f336f8cfab
commit 9907deaed2

View File

@@ -383,12 +383,11 @@ internal.commands = function(opts)
local cmd = string.format([[:%s ]], val.name) local cmd = string.format([[:%s ]], val.name)
if val.nargs == "0" then if val.nargs == "0" then
vim.cmd(cmd) local cr = vim.api.nvim_replace_termcodes("<cr>", true, false, true)
vim.fn.histadd("cmd", val.name) cmd = cmd .. cr
else
vim.cmd [[stopinsert]]
vim.fn.feedkeys(cmd, "n")
end end
vim.cmd [[stopinsert]]
vim.api.nvim_feedkeys(cmd, "t", false)
end) end)
return true return true