mirror of
https://github.com/amix/vimrc
synced 2025-06-16 09:35:01 +08:00
Updated plugins
This commit is contained in:
@ -30,6 +30,21 @@ function! s:groutineID() abort
|
||||
endfunction
|
||||
|
||||
function! s:complete(job, exit_status, data) abort
|
||||
let l:gotready = get(s:state, 'ready', 0)
|
||||
" copy messages to a:data _only_ when dlv exited non-zero and it was never
|
||||
" detected as ready (e.g. there was a compiler error).
|
||||
if a:exit_status > 0 && !l:gotready
|
||||
" copy messages to data so that vim-go's usual handling of errors from
|
||||
" async jobs will occur.
|
||||
call extend(a:data, s:state['message'])
|
||||
endif
|
||||
|
||||
" return early instead of clearing any variables when the current job is not
|
||||
" a:job
|
||||
if has_key(s:state, 'job') && s:state['job'] != a:job
|
||||
return
|
||||
endif
|
||||
|
||||
if has_key(s:state, 'job')
|
||||
call remove(s:state, 'job')
|
||||
endif
|
||||
@ -38,10 +53,11 @@ function! s:complete(job, exit_status, data) abort
|
||||
call remove(s:state, 'ready')
|
||||
endif
|
||||
|
||||
call s:clearState()
|
||||
if a:exit_status > 0
|
||||
call go#util#EchoError(s:state['message'])
|
||||
if has_key(s:state, 'ch')
|
||||
call remove(s:state, 'ch')
|
||||
endif
|
||||
|
||||
call s:clearState()
|
||||
endfunction
|
||||
|
||||
function! s:logger(prefix, ch, msg) abort
|
||||
@ -217,8 +233,8 @@ endfunction
|
||||
function! s:stop() abort
|
||||
let l:res = s:call_jsonrpc('RPCServer.Detach', {'kill': v:true})
|
||||
|
||||
call s:clearState()
|
||||
if has_key(s:state, 'job')
|
||||
call go#job#Wait(s:state['job'])
|
||||
call remove(s:state, 'job')
|
||||
endif
|
||||
|
||||
@ -230,9 +246,7 @@ function! s:stop() abort
|
||||
call remove(s:state, 'ch')
|
||||
endif
|
||||
|
||||
if has_key( s:state, 'data')
|
||||
call remove(s:state, 'data')
|
||||
endif
|
||||
call s:clearState()
|
||||
endfunction
|
||||
|
||||
function! go#debug#Stop() abort
|
||||
@ -473,7 +487,7 @@ function! s:start_cb(res) abort
|
||||
exe bufwinnr(oldbuf) 'wincmd w'
|
||||
|
||||
augroup vim-go-debug
|
||||
autocmd!
|
||||
autocmd! * <buffer>
|
||||
autocmd FileType go nmap <buffer> <F5> <Plug>(go-debug-continue)
|
||||
autocmd FileType go nmap <buffer> <F6> <Plug>(go-debug-print)
|
||||
autocmd FileType go nmap <buffer> <F9> <Plug>(go-debug-breakpoint)
|
||||
@ -489,7 +503,6 @@ function! s:err_cb(ch, msg) abort
|
||||
return
|
||||
endif
|
||||
|
||||
call go#util#EchoError(a:msg)
|
||||
let s:state['message'] += [a:msg]
|
||||
endfunction
|
||||
|
||||
@ -499,7 +512,6 @@ function! s:out_cb(ch, msg) abort
|
||||
return
|
||||
endif
|
||||
|
||||
call go#util#EchoProgress(a:msg)
|
||||
let s:state['message'] += [a:msg]
|
||||
|
||||
if stridx(a:msg, go#config#DebugAddress()) != -1
|
||||
@ -572,7 +584,7 @@ function! go#debug#Start(is_test, ...) abort
|
||||
|
||||
" It's already running.
|
||||
if has_key(s:state, 'job')
|
||||
return
|
||||
return s:state['job']
|
||||
endif
|
||||
|
||||
let s:start_args = a:000
|
||||
@ -634,7 +646,7 @@ function! go#debug#Start(is_test, ...) abort
|
||||
|
||||
let s:state['message'] = []
|
||||
let l:opts = {
|
||||
\ 'for': '_',
|
||||
\ 'for': 'GoDebug',
|
||||
\ 'statustype': 'debug',
|
||||
\ 'complete': function('s:complete'),
|
||||
\ }
|
||||
@ -647,6 +659,8 @@ function! go#debug#Start(is_test, ...) abort
|
||||
catch
|
||||
call go#util#EchoError(v:exception)
|
||||
endtry
|
||||
|
||||
return s:state['job']
|
||||
endfunction
|
||||
|
||||
" Translate a reflect kind constant to a human string.
|
||||
@ -872,7 +886,7 @@ function! go#debug#Restart() abort
|
||||
call go#cmd#autowrite()
|
||||
|
||||
try
|
||||
call go#job#Stop(s:state['job'])
|
||||
call s:stop()
|
||||
|
||||
let l:breaks = s:state['breakpoint']
|
||||
let s:state = {
|
||||
|
Reference in New Issue
Block a user