feat(term): add string.format to term cmds

This commit is contained in:
Asbjørn Håland 2021-04-21 21:08:27 +02:00
parent 8b785eafe5
commit 70d02464bf

View File

@ -52,7 +52,7 @@ M.gotoTerminal = function(idx)
vim.api.nvim_set_current_buf(term_handle.buf_id)
end
M.sendCommand = function(idx, cmd)
M.sendCommand = function(idx, cmd, ...)
local term_handle = find_terminal(idx)
if type(cmd) == "number" then
@ -60,7 +60,7 @@ M.sendCommand = function(idx, cmd)
end
if cmd then
vim.fn.chansend(term_handle.term_id, cmd)
vim.fn.chansend(term_handle.term_id, string.format(cmd, ...))
end
end