mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-09 10:00:04 +08:00
feat(git.vim): use derived logger if exists
This commit is contained in:
parent
8091388658
commit
e542809569
4
bundle/git.vim/autoload/git/add.vim
vendored
4
bundle/git.vim/autoload/git/add.vim
vendored
@ -24,7 +24,7 @@ endfunction
|
|||||||
|
|
||||||
function! git#add#run(argvs) abort
|
function! git#add#run(argvs) abort
|
||||||
let cmd = ['git', 'add'] + s:replace_argvs(a:argvs)
|
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,
|
call s:JOB.start(cmd,
|
||||||
\ {
|
\ {
|
||||||
\ 'on_exit' : function('s:on_exit'),
|
\ 'on_exit' : function('s:on_exit'),
|
||||||
@ -34,7 +34,7 @@ function! git#add#run(argvs) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_exit(id, data, event) abort
|
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 a:data ==# 0
|
||||||
if exists(':GitGutter')
|
if exists(':GitGutter')
|
||||||
GitGutter
|
GitGutter
|
||||||
|
8
bundle/git.vim/autoload/git/blame.vim
vendored
8
bundle/git.vim/autoload/git/blame.vim
vendored
@ -11,7 +11,7 @@ function! git#blame#run(...)
|
|||||||
let cmd = ['git', 'blame', '--line-porcelain'] + a:1
|
let cmd = ['git', 'blame', '--line-porcelain'] + a:1
|
||||||
endif
|
endif
|
||||||
let s:lines = []
|
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,
|
call s:JOB.start(cmd,
|
||||||
\ {
|
\ {
|
||||||
\ 'on_stderr' : function('s:on_stderr'),
|
\ 'on_stderr' : function('s:on_stderr'),
|
||||||
@ -23,17 +23,17 @@ endfunction
|
|||||||
|
|
||||||
function! s:on_stdout(id, data, event) abort
|
function! s:on_stdout(id, data, event) abort
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-blame stdout:' . data)
|
call git#logger#debug('git-blame stdout:' . data)
|
||||||
endfor
|
endfor
|
||||||
let s:lines += a:data
|
let s:lines += a:data
|
||||||
endfunction
|
endfunction
|
||||||
function! s:on_stderr(id, data, event) abort
|
function! s:on_stderr(id, data, event) abort
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-blame stderr:' . data)
|
call git#logger#debug('git-blame stderr:' . data)
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
function! s:on_exit(id, data, event) abort
|
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)
|
let rst = s:parser(s:lines)
|
||||||
if !empty(rst)
|
if !empty(rst)
|
||||||
if !bufexists(s:blame_buffer_nr)
|
if !bufexists(s:blame_buffer_nr)
|
||||||
|
4
bundle/git.vim/autoload/git/branch.vim
vendored
4
bundle/git.vim/autoload/git/branch.vim
vendored
@ -25,7 +25,7 @@ function! git#branch#run(args) abort
|
|||||||
else
|
else
|
||||||
let cmd = ['git', 'branch'] + a:args
|
let cmd = ['git', 'branch'] + a:args
|
||||||
endif
|
endif
|
||||||
call git#logger#info('git-branch cmd:' . string(cmd))
|
call git#logger#debug('git-branch cmd:' . string(cmd))
|
||||||
call s:JOB.start(cmd,
|
call s:JOB.start(cmd,
|
||||||
\ {
|
\ {
|
||||||
\ 'on_stderr' : function('s:on_stderr'),
|
\ 'on_stderr' : function('s:on_stderr'),
|
||||||
@ -48,7 +48,7 @@ function! s:on_stderr(id, data, event) abort
|
|||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
function! s:on_exit(id, data, event) abort
|
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
|
if a:data ==# 0
|
||||||
call git#branch#manager#update()
|
call git#branch#manager#update()
|
||||||
echo 'done!'
|
echo 'done!'
|
||||||
|
@ -57,7 +57,7 @@ endfunction
|
|||||||
function! s:update() abort
|
function! s:update() abort
|
||||||
let s:branchs = []
|
let s:branchs = []
|
||||||
let cmd = ['git', 'branch', '--all']
|
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,
|
call s:JOB.start(cmd,
|
||||||
\ {
|
\ {
|
||||||
\ 'on_stderr' : function('s:on_stderr'),
|
\ 'on_stderr' : function('s:on_stderr'),
|
||||||
@ -108,7 +108,7 @@ function! s:on_stderr(id, data, event) abort
|
|||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
function! s:on_exit(id, data, event) abort
|
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
|
if a:data ==# 0
|
||||||
call s:update_buffer_context()
|
call s:update_buffer_context()
|
||||||
endif
|
endif
|
||||||
|
4
bundle/git.vim/autoload/git/checkout.vim
vendored
4
bundle/git.vim/autoload/git/checkout.vim
vendored
@ -3,7 +3,7 @@ let s:JOB = SpaceVim#api#import('job')
|
|||||||
function! git#checkout#run(args)
|
function! git#checkout#run(args)
|
||||||
|
|
||||||
let cmd = ['git', 'checkout'] + a: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,
|
call s:JOB.start(cmd,
|
||||||
\ {
|
\ {
|
||||||
\ 'on_exit' : function('s:on_exit'),
|
\ 'on_exit' : function('s:on_exit'),
|
||||||
@ -13,7 +13,7 @@ function! git#checkout#run(args)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_exit(id, data, event) abort
|
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
|
if a:data ==# 0
|
||||||
silent! checktime
|
silent! checktime
|
||||||
echo 'checkout done'
|
echo 'checkout done'
|
||||||
|
8
bundle/git.vim/autoload/git/cherry_pick.vim
vendored
8
bundle/git.vim/autoload/git/cherry_pick.vim
vendored
@ -14,7 +14,7 @@ function! git#cherry_pick#run(args) abort
|
|||||||
else
|
else
|
||||||
let cmd = ['git', 'cherry-pick'] + a:args
|
let cmd = ['git', 'cherry-pick'] + a:args
|
||||||
endif
|
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 = []
|
let s:conflict_files = []
|
||||||
call s:JOB.start(cmd,
|
call s:JOB.start(cmd,
|
||||||
\ {
|
\ {
|
||||||
@ -27,7 +27,7 @@ function! git#cherry_pick#run(args) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_exit(id, data, event) abort
|
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
|
if a:data ==# 0
|
||||||
echo 'cherry-pick done!'
|
echo 'cherry-pick done!'
|
||||||
else
|
else
|
||||||
@ -41,7 +41,7 @@ endfunction
|
|||||||
|
|
||||||
function! s:on_stdout(id, data, event) abort
|
function! s:on_stdout(id, data, event) abort
|
||||||
for data in a:data
|
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'
|
if data =~# '^CONFLICT'
|
||||||
" CONFLICT (content): Merge conflict in test.txt
|
" CONFLICT (content): Merge conflict in test.txt
|
||||||
let file = data[38:]
|
let file = data[38:]
|
||||||
@ -52,7 +52,7 @@ endfunction
|
|||||||
|
|
||||||
function! s:on_stderr(id, data, event) abort
|
function! s:on_stderr(id, data, event) abort
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-cherry-pick stderr:' . data)
|
call git#logger#debug('git-cherry-pick stderr:' . data)
|
||||||
endfor
|
endfor
|
||||||
" stderr should not be added to commit buffer
|
" stderr should not be added to commit buffer
|
||||||
" let s:lines += a:data
|
" let s:lines += a:data
|
||||||
|
4
bundle/git.vim/autoload/git/clean.vim
vendored
4
bundle/git.vim/autoload/git/clean.vim
vendored
@ -12,7 +12,7 @@ let s:NOTI = SpaceVim#api#import('notify')
|
|||||||
function! git#clean#run(argvs) abort
|
function! git#clean#run(argvs) abort
|
||||||
|
|
||||||
let cmd = ['git', 'clean'] + a:argvs
|
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,
|
call s:JOB.start(cmd,
|
||||||
\ {
|
\ {
|
||||||
\ 'on_stdout' : function('s:on_stdout'),
|
\ 'on_stdout' : function('s:on_stdout'),
|
||||||
@ -31,7 +31,7 @@ function! s:on_stderr(id, data, event) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_exit(id, data, event) abort
|
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
|
if a:data ==# 0
|
||||||
call s:NOTI.notify('stage files done!')
|
call s:NOTI.notify('stage files done!')
|
||||||
else
|
else
|
||||||
|
8
bundle/git.vim/autoload/git/commit.vim
vendored
8
bundle/git.vim/autoload/git/commit.vim
vendored
@ -57,7 +57,7 @@ function! s:on_stdout(id, data, event) abort
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-commit stdout:' . data)
|
call git#logger#debug('git-commit stdout:' . data)
|
||||||
endfor
|
endfor
|
||||||
let s:commit_context += a:data
|
let s:commit_context += a:data
|
||||||
endfunction
|
endfunction
|
||||||
@ -67,7 +67,7 @@ function! s:on_stderr(id, data, event) abort
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-commit stderr:' . data)
|
call git#logger#debug('git-commit stderr:' . data)
|
||||||
endfor
|
endfor
|
||||||
" stderr should not be added to commit buffer
|
" stderr should not be added to commit buffer
|
||||||
" let s:commit_context += a:data
|
" let s:commit_context += a:data
|
||||||
@ -77,7 +77,7 @@ function! s:on_exit(id, data, event) abort
|
|||||||
" ignore previous git commit job
|
" ignore previous git commit job
|
||||||
return
|
return
|
||||||
endif
|
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 s:commit_bufnr == -1
|
||||||
if a:data ==# 0
|
if a:data ==# 0
|
||||||
call s:NOTI.notify('commit done!')
|
call s:NOTI.notify('commit done!')
|
||||||
@ -141,7 +141,7 @@ function! s:WinLeave() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_commit_exit(id, data, event) abort
|
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
|
if a:data ==# 0
|
||||||
call s:NOTI.notify('commit done!')
|
call s:NOTI.notify('commit done!')
|
||||||
else
|
else
|
||||||
|
6
bundle/git.vim/autoload/git/config.vim
vendored
6
bundle/git.vim/autoload/git/config.vim
vendored
@ -9,7 +9,7 @@ function! git#config#run(argvs)
|
|||||||
let cmd = ['git', 'config'] + a:argvs
|
let cmd = ['git', 'config'] + a:argvs
|
||||||
endif
|
endif
|
||||||
let s:lines = []
|
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,
|
call s:JOB.start(cmd,
|
||||||
\ {
|
\ {
|
||||||
\ 'on_exit' : function('s:on_exit'),
|
\ 'on_exit' : function('s:on_exit'),
|
||||||
@ -21,13 +21,13 @@ endfunction
|
|||||||
|
|
||||||
function! s:on_stdout(id, data, event) abort
|
function! s:on_stdout(id, data, event) abort
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-config stdout:' . data)
|
call git#logger#debug('git-config stdout:' . data)
|
||||||
endfor
|
endfor
|
||||||
let s:lines += a:data
|
let s:lines += a:data
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_exit(id, data, event) abort
|
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
|
if a:data ==# 0
|
||||||
let s:bufnr = s:openConfigBuffer(len(s:lines))
|
let s:bufnr = s:openConfigBuffer(len(s:lines))
|
||||||
call s:BUFFER.buf_set_lines(s:bufnr, 0 , -1, 0, s:lines)
|
call s:BUFFER.buf_set_lines(s:bufnr, 0 , -1, 0, s:lines)
|
||||||
|
8
bundle/git.vim/autoload/git/diff.vim
vendored
8
bundle/git.vim/autoload/git/diff.vim
vendored
@ -8,7 +8,7 @@ function! git#diff#run(...)
|
|||||||
let cmd = ['git', 'diff'] + a:1
|
let cmd = ['git', 'diff'] + a:1
|
||||||
endif
|
endif
|
||||||
let s:lines = []
|
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,
|
call s:JOB.start(cmd,
|
||||||
\ {
|
\ {
|
||||||
\ 'on_stderr' : function('s:on_stderr'),
|
\ 'on_stderr' : function('s:on_stderr'),
|
||||||
@ -20,18 +20,18 @@ endfunction
|
|||||||
|
|
||||||
function! s:on_stdout(id, data, event) abort
|
function! s:on_stdout(id, data, event) abort
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-diff stdout:' . data)
|
call git#logger#debug('git-diff stdout:' . data)
|
||||||
endfor
|
endfor
|
||||||
let s:lines += a:data
|
let s:lines += a:data
|
||||||
endfunction
|
endfunction
|
||||||
function! s:on_stderr(id, data, event) abort
|
function! s:on_stderr(id, data, event) abort
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-diff stderr:' . data)
|
call git#logger#debug('git-diff stderr:' . data)
|
||||||
endfor
|
endfor
|
||||||
let s:lines += a:data
|
let s:lines += a:data
|
||||||
endfunction
|
endfunction
|
||||||
function! s:on_exit(id, data, event) abort
|
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()
|
let s:bufnr = s:openDiffBuffer()
|
||||||
call setbufvar(s:bufnr, 'modifiable', 1)
|
call setbufvar(s:bufnr, 'modifiable', 1)
|
||||||
call s:BUFFER.buf_set_lines(s:bufnr, 0 , -1, 0, s:lines)
|
call s:BUFFER.buf_set_lines(s:bufnr, 0 , -1, 0, s:lines)
|
||||||
|
4
bundle/git.vim/autoload/git/fetch.vim
vendored
4
bundle/git.vim/autoload/git/fetch.vim
vendored
@ -3,7 +3,7 @@ let s:JOB = SpaceVim#api#import('job')
|
|||||||
function! git#fetch#run(args)
|
function! git#fetch#run(args)
|
||||||
|
|
||||||
let cmd = ['git', 'fetch'] + a: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,
|
call s:JOB.start(cmd,
|
||||||
\ {
|
\ {
|
||||||
\ 'on_exit' : function('s:on_exit'),
|
\ 'on_exit' : function('s:on_exit'),
|
||||||
@ -13,7 +13,7 @@ function! git#fetch#run(args)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_exit(id, data, event) abort
|
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
|
if a:data ==# 0
|
||||||
echo 'fetch done!'
|
echo 'fetch done!'
|
||||||
else
|
else
|
||||||
|
10
bundle/git.vim/autoload/git/log.vim
vendored
10
bundle/git.vim/autoload/git/log.vim
vendored
@ -11,7 +11,7 @@ function! git#log#run(...) abort
|
|||||||
else
|
else
|
||||||
let cmd = ['git', 'log', '--graph', '--date=relative', '--pretty=' . g:git_log_pretty] + a:1
|
let cmd = ['git', 'log', '--graph', '--date=relative', '--pretty=' . g:git_log_pretty] + a:1
|
||||||
endif
|
endif
|
||||||
call git#logger#info('git-log cmd:' . string(cmd))
|
call git#logger#debug('git-log cmd:' . string(cmd))
|
||||||
call s:JOB.start(cmd,
|
call s:JOB.start(cmd,
|
||||||
\ {
|
\ {
|
||||||
\ 'on_stderr' : function('s:on_stderr'),
|
\ 'on_stderr' : function('s:on_stderr'),
|
||||||
@ -35,7 +35,7 @@ function! s:on_stderr(id, data, event) abort
|
|||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
function! s:on_exit(id, data, event) abort
|
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
|
endfunction
|
||||||
|
|
||||||
function! s:openLogBuffer() abort
|
function! s:openLogBuffer() abort
|
||||||
@ -81,18 +81,18 @@ endfunction
|
|||||||
|
|
||||||
function! s:on_show_stdout(id, data, event) abort
|
function! s:on_show_stdout(id, data, event) abort
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-show stdout:' . data)
|
call git#logger#debug('git-show stdout:' . data)
|
||||||
endfor
|
endfor
|
||||||
let s:show_lines += filter(a:data, '!empty(v:val)')
|
let s:show_lines += filter(a:data, '!empty(v:val)')
|
||||||
endfunction
|
endfunction
|
||||||
function! s:on_show_stderr(id, data, event) abort
|
function! s:on_show_stderr(id, data, event) abort
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-show stderr:' . data)
|
call git#logger#debug('git-show stderr:' . data)
|
||||||
endfor
|
endfor
|
||||||
let s:show_lines += filter(a:data, '!empty(v:val)')
|
let s:show_lines += filter(a:data, '!empty(v:val)')
|
||||||
endfunction
|
endfunction
|
||||||
function! s:on_show_exit(id, data, event) abort
|
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)
|
call s:BUFFER.buf_set_lines(s:show_commit_buffer, 0 , -1, 0, s:show_lines)
|
||||||
endfunction
|
endfunction
|
||||||
function! s:openShowCommitBuffer() abort
|
function! s:openShowCommitBuffer() abort
|
||||||
|
72
bundle/git.vim/autoload/git/logger.vim
vendored
72
bundle/git.vim/autoload/git/logger.vim
vendored
@ -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')
|
function! git#logger#clear() abort
|
||||||
call s:LOG.set_level(1)
|
" call s:LOG.clear(1)
|
||||||
call s:LOG.set_silent(1)
|
call s:NOTI.notify('using derived logger, can not clear log')
|
||||||
call s:LOG.set_verbose(1)
|
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)
|
function! git#logger#info(msg)
|
||||||
|
call s:LOG.info(a:msg)
|
||||||
call s:LOG.info(a:msg)
|
|
||||||
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! git#logger#debug(msg) abort
|
||||||
function! git#logger#view()
|
call s:LOG.debug(a:msg)
|
||||||
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
|
endfunction
|
||||||
|
|
||||||
function! git#logger#clear() abort
|
|
||||||
call s:LOG.clear(1)
|
|
||||||
endfunction
|
|
||||||
|
8
bundle/git.vim/autoload/git/merge.vim
vendored
8
bundle/git.vim/autoload/git/merge.vim
vendored
@ -6,7 +6,7 @@ function! git#merge#run(args)
|
|||||||
else
|
else
|
||||||
let cmd = ['git', 'merge'] + a:args
|
let cmd = ['git', 'merge'] + a:args
|
||||||
endif
|
endif
|
||||||
call git#logger#info('git-merge cmd:' . string(cmd))
|
call git#logger#debug('git-merge cmd:' . string(cmd))
|
||||||
let s:conflict_files = []
|
let s:conflict_files = []
|
||||||
call s:JOB.start(cmd,
|
call s:JOB.start(cmd,
|
||||||
\ {
|
\ {
|
||||||
@ -19,7 +19,7 @@ function! git#merge#run(args)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_exit(id, data, event) abort
|
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
|
if a:data ==# 0
|
||||||
echo 'merged done!'
|
echo 'merged done!'
|
||||||
else
|
else
|
||||||
@ -30,7 +30,7 @@ endfunction
|
|||||||
|
|
||||||
function! s:on_stdout(id, data, event) abort
|
function! s:on_stdout(id, data, event) abort
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-merge stdout:' . data)
|
call git#logger#debug('git-merge stdout:' . data)
|
||||||
if data =~# '^CONFLICT'
|
if data =~# '^CONFLICT'
|
||||||
" CONFLICT (content): Merge conflict in test.txt
|
" CONFLICT (content): Merge conflict in test.txt
|
||||||
let file = data[38:]
|
let file = data[38:]
|
||||||
@ -41,7 +41,7 @@ endfunction
|
|||||||
|
|
||||||
function! s:on_stderr(id, data, event) abort
|
function! s:on_stderr(id, data, event) abort
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-merge stderr:' . data)
|
call git#logger#debug('git-merge stderr:' . data)
|
||||||
endfor
|
endfor
|
||||||
" stderr should not be added to commit buffer
|
" stderr should not be added to commit buffer
|
||||||
" let s:lines += a:data
|
" let s:lines += a:data
|
||||||
|
4
bundle/git.vim/autoload/git/mv.vim
vendored
4
bundle/git.vim/autoload/git/mv.vim
vendored
@ -17,7 +17,7 @@ function! git#mv#run(args) abort
|
|||||||
let args[index] = expand('%')
|
let args[index] = expand('%')
|
||||||
endif
|
endif
|
||||||
let cmd = ['git', 'mv'] + args
|
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,
|
call s:JOB.start(cmd,
|
||||||
\ {
|
\ {
|
||||||
\ 'on_exit' : function('s:on_exit'),
|
\ 'on_exit' : function('s:on_exit'),
|
||||||
@ -27,7 +27,7 @@ function! git#mv#run(args) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_exit(id, data, event) abort
|
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 a:data ==# 0
|
||||||
if exists(':GitGutter')
|
if exists(':GitGutter')
|
||||||
GitGutter
|
GitGutter
|
||||||
|
8
bundle/git.vim/autoload/git/pull.vim
vendored
8
bundle/git.vim/autoload/git/pull.vim
vendored
@ -2,7 +2,7 @@ let s:JOB = SpaceVim#api#import('job')
|
|||||||
|
|
||||||
function! git#pull#run(args)
|
function! git#pull#run(args)
|
||||||
let cmd = ['git', 'pull'] + a: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 = []
|
let s:conflict_files = []
|
||||||
call s:JOB.start(cmd,
|
call s:JOB.start(cmd,
|
||||||
\ {
|
\ {
|
||||||
@ -15,7 +15,7 @@ function! git#pull#run(args)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_exit(id, data, event) abort
|
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
|
if a:data ==# 0
|
||||||
echo 'pulled done!'
|
echo 'pulled done!'
|
||||||
else
|
else
|
||||||
@ -26,7 +26,7 @@ endfunction
|
|||||||
|
|
||||||
function! s:on_stdout(id, data, event) abort
|
function! s:on_stdout(id, data, event) abort
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-pull stdout:' . data)
|
call git#logger#debug('git-pull stdout:' . data)
|
||||||
if data =~# '^CONFLICT'
|
if data =~# '^CONFLICT'
|
||||||
" CONFLICT (content): Merge conflict in test.txt
|
" CONFLICT (content): Merge conflict in test.txt
|
||||||
let file = data[38:]
|
let file = data[38:]
|
||||||
@ -37,7 +37,7 @@ endfunction
|
|||||||
|
|
||||||
function! s:on_stderr(id, data, event) abort
|
function! s:on_stderr(id, data, event) abort
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-pull stderr:' . data)
|
call git#logger#debug('git-pull stderr:' . data)
|
||||||
endfor
|
endfor
|
||||||
" stderr should not be added to commit buffer
|
" stderr should not be added to commit buffer
|
||||||
" let s:lines += a:data
|
" let s:lines += a:data
|
||||||
|
12
bundle/git.vim/autoload/git/rebase.vim
vendored
12
bundle/git.vim/autoload/git/rebase.vim
vendored
@ -14,7 +14,7 @@ function! git#rebase#run(...) abort
|
|||||||
else
|
else
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
call git#logger#info('git-rebase cmd:' . string(cmd))
|
call git#logger#debug('git-rebase cmd:' . string(cmd))
|
||||||
call s:JOB.start(cmd,
|
call s:JOB.start(cmd,
|
||||||
\ {
|
\ {
|
||||||
\ 'on_stderr' : function('s:on_stderr'),
|
\ 'on_stderr' : function('s:on_stderr'),
|
||||||
@ -26,19 +26,19 @@ endfunction
|
|||||||
|
|
||||||
function! s:on_stdout(id, data, event) abort
|
function! s:on_stdout(id, data, event) abort
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-rebase stdout:' . data)
|
call git#logger#debug('git-rebase stdout:' . data)
|
||||||
endfor
|
endfor
|
||||||
let s:lines += a:data
|
let s:lines += a:data
|
||||||
endfunction
|
endfunction
|
||||||
function! s:on_stderr(id, data, event) abort
|
function! s:on_stderr(id, data, event) abort
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-rebase stderr:' . data)
|
call git#logger#debug('git-rebase stderr:' . data)
|
||||||
endfor
|
endfor
|
||||||
" stderr should not be added to commit buffer
|
" stderr should not be added to commit buffer
|
||||||
" let s:lines += a:data
|
" let s:lines += a:data
|
||||||
endfunction
|
endfunction
|
||||||
function! s:on_exit(id, data, event) abort
|
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)
|
call s:BUFFER.buf_set_lines(s:bufnr, 0 , -1, 0, s:lines)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ endfunction
|
|||||||
function! s:WinLeave() abort
|
function! s:WinLeave() abort
|
||||||
if b:git_rebase_quitpre == 1
|
if b:git_rebase_quitpre == 1
|
||||||
let cmd = ['git', 'rebase', '--continue']
|
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,
|
let id = s:JOB.start(cmd,
|
||||||
\ {
|
\ {
|
||||||
\ 'on_exit' : function('s:on_rebase_continue'),
|
\ 'on_exit' : function('s:on_rebase_continue'),
|
||||||
@ -94,7 +94,7 @@ function! s:WinLeave() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_rebase_continue(id, data, event) abort
|
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
|
if a:data ==# 0
|
||||||
echo 'done!'
|
echo 'done!'
|
||||||
else
|
else
|
||||||
|
8
bundle/git.vim/autoload/git/reflog.vim
vendored
8
bundle/git.vim/autoload/git/reflog.vim
vendored
@ -5,7 +5,7 @@ function! git#reflog#run(args)
|
|||||||
let cmd = ['git', 'reflog'] + a:args
|
let cmd = ['git', 'reflog'] + a:args
|
||||||
let s:bufnr = s:openRefLogBuffer()
|
let s:bufnr = s:openRefLogBuffer()
|
||||||
let s:lines = []
|
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,
|
call s:JOB.start(cmd,
|
||||||
\ {
|
\ {
|
||||||
\ 'on_stderr' : function('s:on_stderr'),
|
\ 'on_stderr' : function('s:on_stderr'),
|
||||||
@ -17,18 +17,18 @@ endfunction
|
|||||||
|
|
||||||
function! s:on_stdout(id, data, event) abort
|
function! s:on_stdout(id, data, event) abort
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-reflog stdout:' . data)
|
call git#logger#debug('git-reflog stdout:' . data)
|
||||||
endfor
|
endfor
|
||||||
let s:lines += filter(a:data, '!empty(v:val)')
|
let s:lines += filter(a:data, '!empty(v:val)')
|
||||||
endfunction
|
endfunction
|
||||||
function! s:on_stderr(id, data, event) abort
|
function! s:on_stderr(id, data, event) abort
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-reflog stderr:' . data)
|
call git#logger#debug('git-reflog stderr:' . data)
|
||||||
endfor
|
endfor
|
||||||
let s:lines += a:data
|
let s:lines += a:data
|
||||||
endfunction
|
endfunction
|
||||||
function! s:on_exit(id, data, event) abort
|
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)
|
call s:BUFFER.buf_set_lines(s:bufnr, 0 , -1, 0, s:lines)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
4
bundle/git.vim/autoload/git/reset.vim
vendored
4
bundle/git.vim/autoload/git/reset.vim
vendored
@ -8,7 +8,7 @@ function! git#reset#run(args)
|
|||||||
else
|
else
|
||||||
let cmd = ['git', 'reset'] + a:args
|
let cmd = ['git', 'reset'] + a:args
|
||||||
endif
|
endif
|
||||||
call git#logger#info('git-reset cmd:' . string(cmd))
|
call git#logger#debug('git-reset cmd:' . string(cmd))
|
||||||
call s:JOB.start(cmd,
|
call s:JOB.start(cmd,
|
||||||
\ {
|
\ {
|
||||||
\ 'on_exit' : function('s:on_exit'),
|
\ 'on_exit' : function('s:on_exit'),
|
||||||
@ -18,7 +18,7 @@ function! git#reset#run(args)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_exit(id, data, event) abort
|
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 a:data ==# 0
|
||||||
if exists(':GitGutter')
|
if exists(':GitGutter')
|
||||||
GitGutter
|
GitGutter
|
||||||
|
4
bundle/git.vim/autoload/git/rm.vim
vendored
4
bundle/git.vim/autoload/git/rm.vim
vendored
@ -16,7 +16,7 @@ function! git#rm#run(files) abort
|
|||||||
else
|
else
|
||||||
let cmd = ['git', 'rm'] + a:files
|
let cmd = ['git', 'rm'] + a:files
|
||||||
endif
|
endif
|
||||||
call git#logger#info('git-rm cmd:' . string(cmd))
|
call git#logger#debug('git-rm cmd:' . string(cmd))
|
||||||
call s:JOB.start(cmd,
|
call s:JOB.start(cmd,
|
||||||
\ {
|
\ {
|
||||||
\ 'on_exit' : function('s:on_exit'),
|
\ 'on_exit' : function('s:on_exit'),
|
||||||
@ -26,7 +26,7 @@ function! git#rm#run(files) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_exit(id, data, event) abort
|
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 a:data ==# 0
|
||||||
if exists(':GitGutter')
|
if exists(':GitGutter')
|
||||||
GitGutter
|
GitGutter
|
||||||
|
20
bundle/git.vim/autoload/git/stash.vim
vendored
20
bundle/git.vim/autoload/git/stash.vim
vendored
@ -23,7 +23,7 @@ function! git#stash#run(args) abort
|
|||||||
let subcmd = ''
|
let subcmd = ''
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call git#logger#info('git-stash cmd:' . string(cmd))
|
call git#logger#debug('git-stash cmd:' . string(cmd))
|
||||||
let s:lines = []
|
let s:lines = []
|
||||||
call s:JOB.start(cmd,
|
call s:JOB.start(cmd,
|
||||||
\ {
|
\ {
|
||||||
@ -36,19 +36,19 @@ endfunction
|
|||||||
|
|
||||||
function! s:on_stdout(id, data, event) abort
|
function! s:on_stdout(id, data, event) abort
|
||||||
for line in filter(a:data, '!empty(v:val)')
|
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')
|
call s:NOTI.notify(line, 'Normal')
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_stderr(id, data, event) abort
|
function! s:on_stderr(id, data, event) abort
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-stash stderr:' . data)
|
call git#logger#debug('git-stash stderr:' . data)
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_exit(id, data, event) abort
|
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
|
if a:data ==# 0
|
||||||
" echo 'done!'
|
" echo 'done!'
|
||||||
else
|
else
|
||||||
@ -58,20 +58,20 @@ endfunction
|
|||||||
|
|
||||||
function! s:on_drop_stdout(id, data, event) abort
|
function! s:on_drop_stdout(id, data, event) abort
|
||||||
for line in filter(a:data, '!empty(v:val)')
|
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')
|
call s:NOTI.notify(line, 'Normal')
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_drop_stderr(id, data, event) abort
|
function! s:on_drop_stderr(id, data, event) abort
|
||||||
for line in filter(a:data, '!empty(v:val)')
|
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')
|
call s:NOTI.notify(line, 'WarningMsg')
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_drop_exit(id, data, event) abort
|
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
|
if a:data ==# 0
|
||||||
" echo 'done!'
|
" echo 'done!'
|
||||||
else
|
else
|
||||||
@ -81,20 +81,20 @@ endfunction
|
|||||||
|
|
||||||
function! s:on_show_stdout(id, data, event) abort
|
function! s:on_show_stdout(id, data, event) abort
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-stash stdout:' . data)
|
call git#logger#debug('git-stash stdout:' . data)
|
||||||
endfor
|
endfor
|
||||||
let s:lines += a:data
|
let s:lines += a:data
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_show_stderr(id, data, event) abort
|
function! s:on_show_stderr(id, data, event) abort
|
||||||
for line in filter(a:data, '!empty(v:val)')
|
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')
|
call s:NOTI.notify(line, 'WarningMsg')
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_show_exit(id, data, event) abort
|
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 a:data ==# 0
|
||||||
if !bufexists(s:stash_show_bufnr)
|
if !bufexists(s:stash_show_bufnr)
|
||||||
let s:stash_show_bufnr = s:openStashShowBuffer()
|
let s:stash_show_bufnr = s:openStashShowBuffer()
|
||||||
|
8
bundle/git.vim/autoload/git/status.vim
vendored
8
bundle/git.vim/autoload/git/status.vim
vendored
@ -12,7 +12,7 @@ function! git#status#run(...) abort
|
|||||||
endif
|
endif
|
||||||
let cmd = ['git', 'status', '.']
|
let cmd = ['git', 'status', '.']
|
||||||
let s:lines = []
|
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,
|
call s:JOB.start(cmd,
|
||||||
\ {
|
\ {
|
||||||
\ 'on_stderr' : function('s:on_stderr'),
|
\ 'on_stderr' : function('s:on_stderr'),
|
||||||
@ -24,18 +24,18 @@ endfunction
|
|||||||
|
|
||||||
function! s:on_stdout(id, data, event) abort
|
function! s:on_stdout(id, data, event) abort
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-status stdout:' . data)
|
call git#logger#debug('git-status stdout:' . data)
|
||||||
endfor
|
endfor
|
||||||
let s:lines += a:data
|
let s:lines += a:data
|
||||||
endfunction
|
endfunction
|
||||||
function! s:on_stderr(id, data, event) abort
|
function! s:on_stderr(id, data, event) abort
|
||||||
for data in a:data
|
for data in a:data
|
||||||
call git#logger#info('git-status stderr:' . data)
|
call git#logger#debug('git-status stderr:' . data)
|
||||||
endfor
|
endfor
|
||||||
let s:lines += a:data
|
let s:lines += a:data
|
||||||
endfunction
|
endfunction
|
||||||
function! s:on_exit(id, data, event) abort
|
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)
|
call s:BUFFER.buf_set_lines(s:status_bufnr, 0 , -1, 0, s:lines)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user