Fixed gotobuffer

Fixed GotoBuffer to go to a terminal which
is already closed.
This commit is contained in:
JimboKearn 2020-11-11 21:35:44 +05:30
parent 4390b4c157
commit b0a55a94ec

View File

@ -20,6 +20,14 @@ fun! GotoBuffer(ctrlId)
echo "Unable to create a terminal or find the terminal's information."
end
let bufh = l:contents[1]
if !bufexists(bufh)
" Create the terminal
terminal
call SetBuffer(a:ctrlId)
endif
let contents = g:win_ctrl_buf_list[a:ctrlId]
let bufh = l:contents[1]
call nvim_win_set_buf(0, l:bufh)
endfun
@ -55,7 +63,3 @@ fun! SendTerminalCommand(ctrlId, command)
let job_id = l:contents[0]
call chansend(l:job_id, a:command)
endfun