From af2b1f9071a8bc813f26a94e25dd08c3eb57e2a1 Mon Sep 17 00:00:00 2001 From: ThePrimeagen Date: Wed, 24 Feb 2021 18:50:53 -0700 Subject: [PATCH] look, a commit message class --- lua/harpoon/term.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/harpoon/term.lua b/lua/harpoon/term.lua index 967eec5..8c4dcf1 100644 --- a/lua/harpoon/term.lua +++ b/lua/harpoon/term.lua @@ -29,11 +29,12 @@ end M.gotoTerminal = function(idx) local term_handle = terminals[idx] - if not term_handle then + if not term_handle or nvim_is_buf_valid(term_handle.buf_id) then local buf_id, term_id = create_terminal() if buf_id == nil then return end + term_handle = { buf_id = buf_id, term_id = term_id