Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions lua/nvterm/terminal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,16 @@ local call_and_restore = function(fn, opts)
vim.cmd(mode)
end

nvterm.send = function(cmd, type)
nvterm.send = function(cmd, type, focus)
if not cmd then
return
end
call_and_restore(ensure_and_send, { cmd, type })

if not focus then
call_and_restore(ensure_and_send, { cmd, type })
else
ensure_and_send(cmd, type)
end
end

nvterm.hide_term = function(term)
Expand Down Expand Up @@ -152,7 +157,6 @@ nvterm.toggle_all_terms = function()
end
end


nvterm.close_all_terms = function()
for _, buf in ipairs(nvterm.list_active_terms "buf") do
vim.cmd("bd! " .. tostring(buf))
Expand Down