Skip to content
Open
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
33 changes: 19 additions & 14 deletions autoload/go/cmd.vim
Original file line number Diff line number Diff line change
Expand Up @@ -138,20 +138,6 @@ function! go#cmd#Run(bang, ...) abort
return
endif

if go#util#has_job()
" NOTE(arslan): 'term': 'open' case is not implement for +jobs. This means
" executions waiting for stdin will not work. That's why we don't do
" anything. Once this is implemented we're going to make :GoRun async
endif

let l:status = {
\ 'desc': 'current status',
\ 'type': 'run',
\ 'state': "started",
\ }

call go#statusline#Update(expand('%:p:h'), l:status)

let l:cmd = ['go', 'run']
let l:tags = go#config#BuildTags()
if len(l:tags) > 0
Expand All @@ -165,6 +151,25 @@ function! go#cmd#Run(bang, ...) abort
endif

let l:cmd = l:cmd + l:files
" NOTE(arslan): 'term': 'open' case is not implement for +jobs. This means
" executions waiting for stdin will not work.
if go#util#has_job()
call s:cmd_job({
\ 'cmd': l:cmd,
\ 'bang': a:bang,
\ 'for': 'GoRun',
\ 'statustype': 'run',
\ 'errorformat': s:runerrorformat()
\})
return
endif

let l:status = {
\ 'desc': 'current status',
\ 'type': 'run',
\ 'state': "started",
\ }
call go#statusline#Update(expand('%:p:h'), l:status)

if go#util#IsWin()
if go#util#HasDebug('shell-commands')
Expand Down