Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change to appropriate dir before quickfix parse #2401

Merged
merged 2 commits into from
Jul 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions autoload/go/term.vim
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ 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
" 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"))

let l:winid = win_getid(winnr())
call win_gotoid(self.winid)
let l:listtype = go#list#Type("_term")
Expand Down Expand Up @@ -140,6 +147,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
execute l:cd l:dir
endfunction

" restore Vi compatibility settings
Expand Down