Skip to content

Commit

Permalink
Merge pull request #1145 from entombedvirus/fix_jobcontrol_on_exit_err
Browse files Browse the repository at this point in the history
fixes #1144: "E118: Too many arguments for function: <SNR>173_on_exit"
  • Loading branch information
fatih authored Dec 17, 2016
2 parents 709a458 + 39ebca3 commit 8e44afc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions autoload/go/jobcontrol.vim
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ endfunction
" GOPATH when g:go_autodetect_gopath is enabled. The job is started inside the
" current files folder.
function! s:spawn(bang, desc, args) abort
let job = {
\ 'desc': a:desc,
\ 'bang': a:bang,
let job = {
\ 'desc': a:desc,
\ 'bang': a:bang,
\ 'winnr': winnr(),
\ 'importpath': go#package#ImportPath(expand('%:p:h')),
\ 'state': "RUNNING",
Expand Down Expand Up @@ -90,7 +90,7 @@ endfunction
" references and also displaying errors in the quickfix window collected by
" on_stderr handler. If there are no errors and a quickfix window is open,
" it'll be closed.
function! s:on_exit(job_id, exit_status) abort
function! s:on_exit(job_id, exit_status, event) dict abort
let std_combined = self.stderr + self.stdout

let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
Expand Down Expand Up @@ -147,14 +147,14 @@ function! s:callback_handlers_on_exit(job, exit_status, data) abort
endfunction

" on_stdout is the stdout handler for jobstart(). It collects the output of
" stderr and stores them to the jobs internal stdout list.
function! s:on_stdout(job_id, data) abort
" stderr and stores them to the jobs internal stdout list.
function! s:on_stdout(job_id, data) dict abort
call extend(self.stdout, a:data)
endfunction

" on_stderr is the stderr handler for jobstart(). It collects the output of
" stderr and stores them to the jobs internal stderr list.
function! s:on_stderr(job_id, data) abort
function! s:on_stderr(job_id, data) dict abort
call extend(self.stderr, a:data)
endfunction

Expand Down
10 changes: 5 additions & 5 deletions autoload/go/term.vim
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function! go#term#newmode(bang, cmd, mode) abort
setlocal noswapfile
setlocal nobuflisted

let job = {
let job = {
\ 'stderr' : [],
\ 'stdout' : [],
\ 'bang' : a:bang,
Expand Down Expand Up @@ -75,7 +75,7 @@ function! go#term#newmode(bang, cmd, mode) abort
return id
endfunction

function! s:on_stdout(job_id, data) abort
function! s:on_stdout(job_id, data, event) dict abort
if !has_key(s:jobs, a:job_id)
return
endif
Expand All @@ -84,7 +84,7 @@ function! s:on_stdout(job_id, data) abort
call extend(job.stdout, a:data)
endfunction

function! s:on_stderr(job_id, data) abort
function! s:on_stderr(job_id, data, event) dict abort
if !has_key(s:jobs, a:job_id)
return
endif
Expand All @@ -93,7 +93,7 @@ function! s:on_stderr(job_id, data) abort
call extend(job.stderr, a:data)
endfunction

function! s:on_exit(job_id, exit_status) abort
function! s:on_exit(job_id, exit_status, event) dict abort
if !has_key(s:jobs, a:job_id)
return
endif
Expand All @@ -114,7 +114,7 @@ function! s:on_exit(job_id, exit_status) abort

if !empty(errors)
" close terminal we don't need it anymore
close
close

call go#list#Populate(l:listtype, errors, job.cmd)
call go#list#Window(l:listtype, len(errors))
Expand Down

0 comments on commit 8e44afc

Please sign in to comment.