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

(cherry picked from commit 9907deaed2)
This commit is contained in:
Liu
2024-03-06 10:36:06 +01:00
committed by Simon Hauser
parent d90956833d
commit 1bec1c974e
+4 -5
View File
@@ -383,12 +383,11 @@ internal.commands = function(opts)
local cmd = string.format([[:%s ]], val.name)
if val.nargs == "0" then
vim.cmd(cmd)
vim.fn.histadd("cmd", val.name)
else
vim.cmd [[stopinsert]]
vim.fn.feedkeys(cmd, "n")
local cr = vim.api.nvim_replace_termcodes("<cr>", true, false, true)
cmd = cmd .. cr
end
vim.cmd [[stopinsert]]
vim.api.nvim_feedkeys(cmd, "t", false)
end)
return true