mirror of
https://github.com/ThePrimeagen/harpoon.git
synced 2025-07-14 01:50:27 +00:00
Merge pull request #60 from asbjornhaland/format_term_cmds
feat(term): add string.format to term cmds
This commit is contained in:
commit
467343b944
@ -52,7 +52,7 @@ M.gotoTerminal = function(idx)
|
|||||||
vim.api.nvim_set_current_buf(term_handle.buf_id)
|
vim.api.nvim_set_current_buf(term_handle.buf_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
M.sendCommand = function(idx, cmd)
|
M.sendCommand = function(idx, cmd, ...)
|
||||||
local term_handle = find_terminal(idx)
|
local term_handle = find_terminal(idx)
|
||||||
|
|
||||||
if type(cmd) == "number" then
|
if type(cmd) == "number" then
|
||||||
@ -60,7 +60,7 @@ M.sendCommand = function(idx, cmd)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if cmd then
|
if cmd then
|
||||||
vim.fn.chansend(term_handle.term_id, cmd)
|
vim.fn.chansend(term_handle.term_id, string.format(cmd, ...))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user