Merge pull request #92 from trewjames/terminal

feat(term): add clear all functionality for terms
This commit is contained in:
ThePrimeagen 2021-08-09 10:21:55 -06:00 committed by GitHub
commit d8610fdc12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,4 +72,12 @@ M.sendCommand = function(idx, cmd, ...)
end
end
M.clear_all = function()
log.trace("clear_all(): Clearing all terminals.")
for _, term in ipairs(terminals) do
vim.api.nvim_buf_delete(term.buf_id, { force = true })
end
terminals = {}
end
return M