1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 22:20:06 +08:00

feat(git.vim): use derived logger if exists

This commit is contained in:
wsdjeg 2023-04-22 23:03:07 +08:00
parent 8091388658
commit e542809569
22 changed files with 118 additions and 102 deletions

View File

@ -24,7 +24,7 @@ endfunction
function! git#add#run(argvs) abort
let cmd = ['git', 'add'] + s:replace_argvs(a:argvs)
call git#logger#info('git-add cmd:' . string(cmd))
call git#logger#debug('git-add cmd:' . string(cmd))
call s:JOB.start(cmd,
\ {
\ 'on_exit' : function('s:on_exit'),
@ -34,7 +34,7 @@ function! git#add#run(argvs) abort
endfunction
function! s:on_exit(id, data, event) abort
call git#logger#info('git-add exit data:' . string(a:data))
call git#logger#debug('git-add exit data:' . string(a:data))
if a:data ==# 0
if exists(':GitGutter')
GitGutter

View File

@ -11,7 +11,7 @@ function! git#blame#run(...)
let cmd = ['git', 'blame', '--line-porcelain'] + a:1
endif
let s:lines = []
call git#logger#info('git-blame cmd:' . string(cmd))
call git#logger#debug('git-blame cmd:' . string(cmd))
call s:JOB.start(cmd,
\ {
\ 'on_stderr' : function('s:on_stderr'),
@ -23,17 +23,17 @@ endfunction
function! s:on_stdout(id, data, event) abort
for data in a:data
call git#logger#info('git-blame stdout:' . data)
call git#logger#debug('git-blame stdout:' . data)
endfor
let s:lines += a:data
endfunction
function! s:on_stderr(id, data, event) abort
for data in a:data
call git#logger#info('git-blame stderr:' . data)
call git#logger#debug('git-blame stderr:' . data)
endfor
endfunction
function! s:on_exit(id, data, event) abort
call git#logger#info('git-blame exit data:' . string(a:data))
call git#logger#debug('git-blame exit data:' . string(a:data))
let rst = s:parser(s:lines)
if !empty(rst)
if !bufexists(s:blame_buffer_nr)

View File

@ -25,7 +25,7 @@ function! git#branch#run(args) abort
else
let cmd = ['git', 'branch'] + a:args
endif
call git#logger#info('git-branch cmd:' . string(cmd))
call git#logger#debug('git-branch cmd:' . string(cmd))
call s:JOB.start(cmd,
\ {
\ 'on_stderr' : function('s:on_stderr'),
@ -48,7 +48,7 @@ function! s:on_stderr(id, data, event) abort
endfor
endfunction
function! s:on_exit(id, data, event) abort
call git#logger#info('git-branch exit data:' . string(a:data))
call git#logger#debug('git-branch exit data:' . string(a:data))
if a:data ==# 0
call git#branch#manager#update()
echo 'done!'

View File

@ -57,7 +57,7 @@ endfunction
function! s:update() abort
let s:branchs = []
let cmd = ['git', 'branch', '--all']
call git#logger#info('git-branch cmd:' . string(cmd))
call git#logger#debug('git-branch cmd:' . string(cmd))
call s:JOB.start(cmd,
\ {
\ 'on_stderr' : function('s:on_stderr'),
@ -108,7 +108,7 @@ function! s:on_stderr(id, data, event) abort
endfor
endfunction
function! s:on_exit(id, data, event) abort
call git#logger#info('git-branch exit data:' . string(a:data))
call git#logger#debug('git-branch exit data:' . string(a:data))
if a:data ==# 0
call s:update_buffer_context()
endif

View File

@ -3,7 +3,7 @@ let s:JOB = SpaceVim#api#import('job')
function! git#checkout#run(args)
let cmd = ['git', 'checkout'] + a:args
call git#logger#info('git-checkout cmd:' . string(cmd))
call git#logger#debug('git-checkout cmd:' . string(cmd))
call s:JOB.start(cmd,
\ {
\ 'on_exit' : function('s:on_exit'),
@ -13,7 +13,7 @@ function! git#checkout#run(args)
endfunction
function! s:on_exit(id, data, event) abort
call git#logger#info('git-checkout exit data:' . string(a:data))
call git#logger#debug('git-checkout exit data:' . string(a:data))
if a:data ==# 0
silent! checktime
echo 'checkout done'

View File

@ -14,7 +14,7 @@ function! git#cherry_pick#run(args) abort
else
let cmd = ['git', 'cherry-pick'] + a:args
endif
call git#logger#info('git-cherry-pick cmd:' . string(cmd))
call git#logger#debug('git-cherry-pick cmd:' . string(cmd))
let s:conflict_files = []
call s:JOB.start(cmd,
\ {
@ -27,7 +27,7 @@ function! git#cherry_pick#run(args) abort
endfunction
function! s:on_exit(id, data, event) abort
call git#logger#info('git-cherry-pick exit data:' . string(a:data))
call git#logger#debug('git-cherry-pick exit data:' . string(a:data))
if a:data ==# 0
echo 'cherry-pick done!'
else
@ -41,7 +41,7 @@ endfunction
function! s:on_stdout(id, data, event) abort
for data in a:data
call git#logger#info('git-cherry-pick stdout:' . data)
call git#logger#debug('git-cherry-pick stdout:' . data)
if data =~# '^CONFLICT'
" CONFLICT (content): Merge conflict in test.txt
let file = data[38:]
@ -52,7 +52,7 @@ endfunction
function! s:on_stderr(id, data, event) abort
for data in a:data
call git#logger#info('git-cherry-pick stderr:' . data)
call git#logger#debug('git-cherry-pick stderr:' . data)
endfor
" stderr should not be added to commit buffer
" let s:lines += a:data

View File

@ -12,7 +12,7 @@ let s:NOTI = SpaceVim#api#import('notify')
function! git#clean#run(argvs) abort
let cmd = ['git', 'clean'] + a:argvs
call git#logger#info('git-clean cmd:' . string(cmd))
call git#logger#debug('git-clean cmd:' . string(cmd))
call s:JOB.start(cmd,
\ {
\ 'on_stdout' : function('s:on_stdout'),
@ -31,7 +31,7 @@ function! s:on_stderr(id, data, event) abort
endfunction
function! s:on_exit(id, data, event) abort
call git#logger#info('git-clean exit data:' . string(a:data))
call git#logger#debug('git-clean exit data:' . string(a:data))
if a:data ==# 0
call s:NOTI.notify('stage files done!')
else

View File

@ -57,7 +57,7 @@ function! s:on_stdout(id, data, event) abort
return
endif
for data in a:data
call git#logger#info('git-commit stdout:' . data)
call git#logger#debug('git-commit stdout:' . data)
endfor
let s:commit_context += a:data
endfunction
@ -67,7 +67,7 @@ function! s:on_stderr(id, data, event) abort
return
endif
for data in a:data
call git#logger#info('git-commit stderr:' . data)
call git#logger#debug('git-commit stderr:' . data)
endfor
" stderr should not be added to commit buffer
" let s:commit_context += a:data
@ -77,7 +77,7 @@ function! s:on_exit(id, data, event) abort
" ignore previous git commit job
return
endif
call git#logger#info('git-exit exit data:' . string(a:data))
call git#logger#debug('git-exit exit data:' . string(a:data))
if s:commit_bufnr == -1
if a:data ==# 0
call s:NOTI.notify('commit done!')
@ -141,7 +141,7 @@ function! s:WinLeave() abort
endfunction
function! s:on_commit_exit(id, data, event) abort
call git#logger#info('git-commit exit data:' . string(a:data))
call git#logger#debug('git-commit exit data:' . string(a:data))
if a:data ==# 0
call s:NOTI.notify('commit done!')
else

View File

@ -9,7 +9,7 @@ function! git#config#run(argvs)
let cmd = ['git', 'config'] + a:argvs
endif
let s:lines = []
call git#logger#info('git-config cmd:' . string(cmd))
call git#logger#debug('git-config cmd:' . string(cmd))
call s:JOB.start(cmd,
\ {
\ 'on_exit' : function('s:on_exit'),
@ -21,13 +21,13 @@ endfunction
function! s:on_stdout(id, data, event) abort
for data in a:data
call git#logger#info('git-config stdout:' . data)
call git#logger#debug('git-config stdout:' . data)
endfor
let s:lines += a:data
endfunction
function! s:on_exit(id, data, event) abort
call git#logger#info('git-config exit data:' . string(a:data))
call git#logger#debug('git-config exit data:' . string(a:data))
if a:data ==# 0
let s:bufnr = s:openConfigBuffer(len(s:lines))
call s:BUFFER.buf_set_lines(s:bufnr, 0 , -1, 0, s:lines)

View File

@ -8,7 +8,7 @@ function! git#diff#run(...)
let cmd = ['git', 'diff'] + a:1
endif
let s:lines = []
call git#logger#info('git-diff cmd:' . string(cmd))
call git#logger#debug('git-diff cmd:' . string(cmd))
call s:JOB.start(cmd,
\ {
\ 'on_stderr' : function('s:on_stderr'),
@ -20,18 +20,18 @@ endfunction
function! s:on_stdout(id, data, event) abort
for data in a:data
call git#logger#info('git-diff stdout:' . data)
call git#logger#debug('git-diff stdout:' . data)
endfor
let s:lines += a:data
endfunction
function! s:on_stderr(id, data, event) abort
for data in a:data
call git#logger#info('git-diff stderr:' . data)
call git#logger#debug('git-diff stderr:' . data)
endfor
let s:lines += a:data
endfunction
function! s:on_exit(id, data, event) abort
call git#logger#info('git-diff exit data:' . string(a:data))
call git#logger#debug('git-diff exit data:' . string(a:data))
let s:bufnr = s:openDiffBuffer()
call setbufvar(s:bufnr, 'modifiable', 1)
call s:BUFFER.buf_set_lines(s:bufnr, 0 , -1, 0, s:lines)

View File

@ -3,7 +3,7 @@ let s:JOB = SpaceVim#api#import('job')
function! git#fetch#run(args)
let cmd = ['git', 'fetch'] + a:args
call git#logger#info('git-fetch cmd:' . string(cmd))
call git#logger#debug('git-fetch cmd:' . string(cmd))
call s:JOB.start(cmd,
\ {
\ 'on_exit' : function('s:on_exit'),
@ -13,7 +13,7 @@ function! git#fetch#run(args)
endfunction
function! s:on_exit(id, data, event) abort
call git#logger#info('git-fetch exit data:' . string(a:data))
call git#logger#debug('git-fetch exit data:' . string(a:data))
if a:data ==# 0
echo 'fetch done!'
else

View File

@ -11,7 +11,7 @@ function! git#log#run(...) abort
else
let cmd = ['git', 'log', '--graph', '--date=relative', '--pretty=' . g:git_log_pretty] + a:1
endif
call git#logger#info('git-log cmd:' . string(cmd))
call git#logger#debug('git-log cmd:' . string(cmd))
call s:JOB.start(cmd,
\ {
\ 'on_stderr' : function('s:on_stderr'),
@ -35,7 +35,7 @@ function! s:on_stderr(id, data, event) abort
endfor
endfunction
function! s:on_exit(id, data, event) abort
call git#logger#info('git-log exit data:' . string(a:data))
call git#logger#debug('git-log exit data:' . string(a:data))
endfunction
function! s:openLogBuffer() abort
@ -81,18 +81,18 @@ endfunction
function! s:on_show_stdout(id, data, event) abort
for data in a:data
call git#logger#info('git-show stdout:' . data)
call git#logger#debug('git-show stdout:' . data)
endfor
let s:show_lines += filter(a:data, '!empty(v:val)')
endfunction
function! s:on_show_stderr(id, data, event) abort
for data in a:data
call git#logger#info('git-show stderr:' . data)
call git#logger#debug('git-show stderr:' . data)
endfor
let s:show_lines += filter(a:data, '!empty(v:val)')
endfunction
function! s:on_show_exit(id, data, event) abort
call git#logger#info('git-show exit data:' . string(a:data))
call git#logger#debug('git-show exit data:' . string(a:data))
call s:BUFFER.buf_set_lines(s:show_commit_buffer, 0 , -1, 0, s:show_lines)
endfunction
function! s:openShowCommitBuffer() abort

View File

@ -1,35 +1,51 @@
let s:LOG = SpaceVim#api#import('logger')
if exists('g:spacevim_version')
let s:LOG = SpaceVim#logger#derive('git.vim')
call s:LOG.start_debug()
let s:NOTI = SpaceVim#api#import('notify')
function! git#logger#view()
call SpaceVim#logger#viewRuntimeLog()
endfunction
call s:LOG.set_name('git.vim')
call s:LOG.set_level(1)
call s:LOG.set_silent(1)
call s:LOG.set_verbose(1)
function! git#logger#clear() abort
" call s:LOG.clear(1)
call s:NOTI.notify('using derived logger, can not clear log')
endfunction
else
let s:LOG = SpaceVim#api#import('logger')
call s:LOG.set_name('git.vim')
call s:LOG.set_level(1)
call s:LOG.set_silent(1)
call s:LOG.set_verbose(1)
function! git#logger#view()
let info = "### git.vim runtime log :\n\n"
let info .= "```log\n"
let info .= s:LOG.view(s:LOG.level)
let info .= "\n```\n"
tabnew +setl\ nobuflisted
nnoremap <buffer><silent> q :bd!<CR>
for msg in split(info, "\n")
call append(line('$'), msg)
endfor
normal! "_dd
setl nomodifiable
setl buftype=nofile
setl filetype=markdown
endfunction
function! git#logger#clear() abort
call s:LOG.clear(1)
endfunction
endif
function! git#logger#info(msg)
call s:LOG.info(a:msg)
call s:LOG.info(a:msg)
endfunction
function! git#logger#view()
let info = "### git.vim runtime log :\n\n"
let info .= "```log\n"
let info .= s:LOG.view(s:LOG.level)
let info .= "\n```\n"
tabnew +setl\ nobuflisted
nnoremap <buffer><silent> q :bd!<CR>
for msg in split(info, "\n")
call append(line('$'), msg)
endfor
normal! "_dd
setl nomodifiable
setl buftype=nofile
setl filetype=markdown
function! git#logger#debug(msg) abort
call s:LOG.debug(a:msg)
endfunction
function! git#logger#clear() abort
call s:LOG.clear(1)
endfunction

View File

@ -6,7 +6,7 @@ function! git#merge#run(args)
else
let cmd = ['git', 'merge'] + a:args
endif
call git#logger#info('git-merge cmd:' . string(cmd))
call git#logger#debug('git-merge cmd:' . string(cmd))
let s:conflict_files = []
call s:JOB.start(cmd,
\ {
@ -19,7 +19,7 @@ function! git#merge#run(args)
endfunction
function! s:on_exit(id, data, event) abort
call git#logger#info('git-merge exit data:' . string(a:data))
call git#logger#debug('git-merge exit data:' . string(a:data))
if a:data ==# 0
echo 'merged done!'
else
@ -30,7 +30,7 @@ endfunction
function! s:on_stdout(id, data, event) abort
for data in a:data
call git#logger#info('git-merge stdout:' . data)
call git#logger#debug('git-merge stdout:' . data)
if data =~# '^CONFLICT'
" CONFLICT (content): Merge conflict in test.txt
let file = data[38:]
@ -41,7 +41,7 @@ endfunction
function! s:on_stderr(id, data, event) abort
for data in a:data
call git#logger#info('git-merge stderr:' . data)
call git#logger#debug('git-merge stderr:' . data)
endfor
" stderr should not be added to commit buffer
" let s:lines += a:data

View File

@ -17,7 +17,7 @@ function! git#mv#run(args) abort
let args[index] = expand('%')
endif
let cmd = ['git', 'mv'] + args
call git#logger#info('git-mv cmd:' . string(cmd))
call git#logger#debug('git-mv cmd:' . string(cmd))
call s:JOB.start(cmd,
\ {
\ 'on_exit' : function('s:on_exit'),
@ -27,7 +27,7 @@ function! git#mv#run(args) abort
endfunction
function! s:on_exit(id, data, event) abort
call git#logger#info('git-mv exit data:' . string(a:data))
call git#logger#debug('git-mv exit data:' . string(a:data))
if a:data ==# 0
if exists(':GitGutter')
GitGutter

View File

@ -2,7 +2,7 @@ let s:JOB = SpaceVim#api#import('job')
function! git#pull#run(args)
let cmd = ['git', 'pull'] + a:args
call git#logger#info('git-pull cmd:' . string(cmd))
call git#logger#debug('git-pull cmd:' . string(cmd))
let s:conflict_files = []
call s:JOB.start(cmd,
\ {
@ -15,7 +15,7 @@ function! git#pull#run(args)
endfunction
function! s:on_exit(id, data, event) abort
call git#logger#info('git-pull exit data:' . string(a:data))
call git#logger#debug('git-pull exit data:' . string(a:data))
if a:data ==# 0
echo 'pulled done!'
else
@ -26,7 +26,7 @@ endfunction
function! s:on_stdout(id, data, event) abort
for data in a:data
call git#logger#info('git-pull stdout:' . data)
call git#logger#debug('git-pull stdout:' . data)
if data =~# '^CONFLICT'
" CONFLICT (content): Merge conflict in test.txt
let file = data[38:]
@ -37,7 +37,7 @@ endfunction
function! s:on_stderr(id, data, event) abort
for data in a:data
call git#logger#info('git-pull stderr:' . data)
call git#logger#debug('git-pull stderr:' . data)
endfor
" stderr should not be added to commit buffer
" let s:lines += a:data

View File

@ -14,7 +14,7 @@ function! git#rebase#run(...) abort
else
finish
endif
call git#logger#info('git-rebase cmd:' . string(cmd))
call git#logger#debug('git-rebase cmd:' . string(cmd))
call s:JOB.start(cmd,
\ {
\ 'on_stderr' : function('s:on_stderr'),
@ -26,19 +26,19 @@ endfunction
function! s:on_stdout(id, data, event) abort
for data in a:data
call git#logger#info('git-rebase stdout:' . data)
call git#logger#debug('git-rebase stdout:' . data)
endfor
let s:lines += a:data
endfunction
function! s:on_stderr(id, data, event) abort
for data in a:data
call git#logger#info('git-rebase stderr:' . data)
call git#logger#debug('git-rebase stderr:' . data)
endfor
" stderr should not be added to commit buffer
" let s:lines += a:data
endfunction
function! s:on_exit(id, data, event) abort
call git#logger#info('git-rebase exit data:' . string(a:data))
call git#logger#debug('git-rebase exit data:' . string(a:data))
call s:BUFFER.buf_set_lines(s:bufnr, 0 , -1, 0, s:lines)
endfunction
@ -83,7 +83,7 @@ endfunction
function! s:WinLeave() abort
if b:git_rebase_quitpre == 1
let cmd = ['git', 'rebase', '--continue']
call git#logger#info('git-rebase cmd:' . string(cmd))
call git#logger#debug('git-rebase cmd:' . string(cmd))
let id = s:JOB.start(cmd,
\ {
\ 'on_exit' : function('s:on_rebase_continue'),
@ -94,7 +94,7 @@ function! s:WinLeave() abort
endfunction
function! s:on_rebase_continue(id, data, event) abort
call git#logger#info('git-rebase exit data:' . string(a:data))
call git#logger#debug('git-rebase exit data:' . string(a:data))
if a:data ==# 0
echo 'done!'
else

View File

@ -5,7 +5,7 @@ function! git#reflog#run(args)
let cmd = ['git', 'reflog'] + a:args
let s:bufnr = s:openRefLogBuffer()
let s:lines = []
call git#logger#info('git-reflog cmd:' . string(cmd))
call git#logger#debug('git-reflog cmd:' . string(cmd))
call s:JOB.start(cmd,
\ {
\ 'on_stderr' : function('s:on_stderr'),
@ -17,18 +17,18 @@ endfunction
function! s:on_stdout(id, data, event) abort
for data in a:data
call git#logger#info('git-reflog stdout:' . data)
call git#logger#debug('git-reflog stdout:' . data)
endfor
let s:lines += filter(a:data, '!empty(v:val)')
endfunction
function! s:on_stderr(id, data, event) abort
for data in a:data
call git#logger#info('git-reflog stderr:' . data)
call git#logger#debug('git-reflog stderr:' . data)
endfor
let s:lines += a:data
endfunction
function! s:on_exit(id, data, event) abort
call git#logger#info('git-reflog exit data:' . string(a:data))
call git#logger#debug('git-reflog exit data:' . string(a:data))
call s:BUFFER.buf_set_lines(s:bufnr, 0 , -1, 0, s:lines)
endfunction

View File

@ -8,7 +8,7 @@ function! git#reset#run(args)
else
let cmd = ['git', 'reset'] + a:args
endif
call git#logger#info('git-reset cmd:' . string(cmd))
call git#logger#debug('git-reset cmd:' . string(cmd))
call s:JOB.start(cmd,
\ {
\ 'on_exit' : function('s:on_exit'),
@ -18,7 +18,7 @@ function! git#reset#run(args)
endfunction
function! s:on_exit(id, data, event) abort
call git#logger#info('git-reset exit data:' . string(a:data))
call git#logger#debug('git-reset exit data:' . string(a:data))
if a:data ==# 0
if exists(':GitGutter')
GitGutter

View File

@ -16,7 +16,7 @@ function! git#rm#run(files) abort
else
let cmd = ['git', 'rm'] + a:files
endif
call git#logger#info('git-rm cmd:' . string(cmd))
call git#logger#debug('git-rm cmd:' . string(cmd))
call s:JOB.start(cmd,
\ {
\ 'on_exit' : function('s:on_exit'),
@ -26,7 +26,7 @@ function! git#rm#run(files) abort
endfunction
function! s:on_exit(id, data, event) abort
call git#logger#info('git-rm exit data:' . string(a:data))
call git#logger#debug('git-rm exit data:' . string(a:data))
if a:data ==# 0
if exists(':GitGutter')
GitGutter

View File

@ -23,7 +23,7 @@ function! git#stash#run(args) abort
let subcmd = ''
endif
call git#logger#info('git-stash cmd:' . string(cmd))
call git#logger#debug('git-stash cmd:' . string(cmd))
let s:lines = []
call s:JOB.start(cmd,
\ {
@ -36,19 +36,19 @@ endfunction
function! s:on_stdout(id, data, event) abort
for line in filter(a:data, '!empty(v:val)')
call git#logger#info('git-stash stdout:' . line)
call git#logger#debug('git-stash stdout:' . line)
call s:NOTI.notify(line, 'Normal')
endfor
endfunction
function! s:on_stderr(id, data, event) abort
for data in a:data
call git#logger#info('git-stash stderr:' . data)
call git#logger#debug('git-stash stderr:' . data)
endfor
endfunction
function! s:on_exit(id, data, event) abort
call git#logger#info('git-stash exit data:' . string(a:data))
call git#logger#debug('git-stash exit data:' . string(a:data))
if a:data ==# 0
" echo 'done!'
else
@ -58,20 +58,20 @@ endfunction
function! s:on_drop_stdout(id, data, event) abort
for line in filter(a:data, '!empty(v:val)')
call git#logger#info('git-stash stdout:' . line)
call git#logger#debug('git-stash stdout:' . line)
call s:NOTI.notify(line, 'Normal')
endfor
endfunction
function! s:on_drop_stderr(id, data, event) abort
for line in filter(a:data, '!empty(v:val)')
call git#logger#info('git-stash stdout:' . line)
call git#logger#debug('git-stash stdout:' . line)
call s:NOTI.notify(line, 'WarningMsg')
endfor
endfunction
function! s:on_drop_exit(id, data, event) abort
call git#logger#info('git-stash exit data:' . string(a:data))
call git#logger#debug('git-stash exit data:' . string(a:data))
if a:data ==# 0
" echo 'done!'
else
@ -81,20 +81,20 @@ endfunction
function! s:on_show_stdout(id, data, event) abort
for data in a:data
call git#logger#info('git-stash stdout:' . data)
call git#logger#debug('git-stash stdout:' . data)
endfor
let s:lines += a:data
endfunction
function! s:on_show_stderr(id, data, event) abort
for line in filter(a:data, '!empty(v:val)')
call git#logger#info('git-stash stdout:' . line)
call git#logger#debug('git-stash stdout:' . line)
call s:NOTI.notify(line, 'WarningMsg')
endfor
endfunction
function! s:on_show_exit(id, data, event) abort
call git#logger#info('git-stash exit data:' . string(a:data))
call git#logger#debug('git-stash exit data:' . string(a:data))
if a:data ==# 0
if !bufexists(s:stash_show_bufnr)
let s:stash_show_bufnr = s:openStashShowBuffer()

View File

@ -12,7 +12,7 @@ function! git#status#run(...) abort
endif
let cmd = ['git', 'status', '.']
let s:lines = []
call git#logger#info('git-status cmd:' . string(cmd))
call git#logger#debug('git-status cmd:' . string(cmd))
call s:JOB.start(cmd,
\ {
\ 'on_stderr' : function('s:on_stderr'),
@ -24,18 +24,18 @@ endfunction
function! s:on_stdout(id, data, event) abort
for data in a:data
call git#logger#info('git-status stdout:' . data)
call git#logger#debug('git-status stdout:' . data)
endfor
let s:lines += a:data
endfunction
function! s:on_stderr(id, data, event) abort
for data in a:data
call git#logger#info('git-status stderr:' . data)
call git#logger#debug('git-status stderr:' . data)
endfor
let s:lines += a:data
endfunction
function! s:on_exit(id, data, event) abort
call git#logger#info('git-status exit data:' . string(a:data))
call git#logger#debug('git-status exit data:' . string(a:data))
call s:BUFFER.buf_set_lines(s:status_bufnr, 0 , -1, 0, s:lines)
endfunction