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

cmd: make :GoRun async #3525

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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