Skip to content

Commit

Permalink
change to appropriate dir before quickfix parse
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis Delossantos committed Jul 15, 2019
1 parent 0a0ded2 commit c397558
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions autoload/go/term.vim
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ function! s:on_stdout(job_id, data, event) dict abort
endfunction

function! s:on_exit(job_id, exit_status, event) dict abort
" change to directory where test were run. if we do not do this
" and the commands are ran from root of the codebase the quickfix location will be wrong
let l:cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
let l:dir = getcwd()
execute l:cd . fnameescape(expand("%:p:h"))

let l:winid = win_getid(winnr())
call win_gotoid(self.winid)
let l:listtype = go#list#Type("_term")
Expand Down Expand Up @@ -140,6 +146,9 @@ function! s:on_exit(job_id, exit_status, event) dict abort

call win_gotoid(self.winid)
call go#list#JumpToFirst(l:listtype)

" change back to original working directory before this method start
execute l:cd l:dir
endfunction

" restore Vi compatibility settings
Expand Down

0 comments on commit c397558

Please sign in to comment.