From 70d02464bf175f40fa36cb714c7b2e99a4e89ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20H=C3=A5land?= Date: Wed, 21 Apr 2021 21:08:27 +0200 Subject: [PATCH] feat(term): add string.format to term cmds --- lua/harpoon/term.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/harpoon/term.lua b/lua/harpoon/term.lua index abd43e6..fd9ded5 100644 --- a/lua/harpoon/term.lua +++ b/lua/harpoon/term.lua @@ -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