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

Parse messages from guru on close_cb, not exit_cb #1439

Merged
merged 1 commit into from
Sep 12, 2017
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
15 changes: 11 additions & 4 deletions autoload/go/guru.vim
Original file line number Diff line number Diff line change
Expand Up @@ -159,31 +159,38 @@ function! s:async_guru(args) abort
call add(messages, a:msg)
endfunction

function! s:exit_cb(job, exitval) closure
let out = join(messages, "\n")
let status = {}
let exitval = 0

function! s:exit_cb(job, exitval) closure
let status = {
\ 'desc': 'last status',
\ 'type': statusline_type,
\ 'state': "finished",
\ }

if a:exitval
let exitval = a:exitval
let status.state = "failed"
endif

call go#statusline#Update(status_dir, status)
endfunction

function! s:close_cb(ch) closure
let out = join(messages, "\n")

if has_key(a:args, 'custom_parse')
call a:args.custom_parse(a:exitval, out)
call a:args.custom_parse(exitval, out)
else
call s:parse_guru_output(a:exitval, out, a:args.mode)
call s:parse_guru_output(exitval, out, a:args.mode)
endif
endfunction

let start_options = {
\ 'callback': funcref("s:callback"),
\ 'exit_cb': funcref("s:exit_cb"),
\ 'close_cb': funcref("s:close_cb"),
\ }

if has_key(result, 'stdin_content')
Expand Down