Skip to content

Commit

Permalink
term: handle buffer/directory deletion on exit
Browse files Browse the repository at this point in the history
Do not try to process the job results of a terminal job if the original
buffer or directory does not exist on exit. This is probably only an
issue in CI.
  • Loading branch information
bhcleek committed Apr 12, 2020
1 parent 8fd4c4a commit 08d131b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion autoload/go/term.vim
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,18 @@ func s:handle_exit(job_id, exit_status, state) abort
let l:winid = win_getid(winnr())
call win_gotoid(a:state.winid)

let l:bufdir = fnameescape(expand('%:p:h'))
if !isdirectory(l:bufdir)
call win_gotoid(l:winid)
return
endif

" change to directory where test were run. if we do not do this
" the quickfix items will have the incorrect paths.
" see: https://github.com/fatih/vim-go/issues/2400
let l:cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
let l:dir = getcwd()
execute l:cd . fnameescape(expand("%:p:h"))
execute l:cd . l:bufdir

let l:listtype = go#list#Type("_term")

Expand Down

0 comments on commit 08d131b

Please sign in to comment.