mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 00:50:05 +08:00
perf(git): use notify api && redrawstatus
This commit is contained in:
parent
e532c6e06b
commit
cd2b5d3a36
4
bundle/git.vim/autoload/git/branch.vim
vendored
4
bundle/git.vim/autoload/git/branch.vim
vendored
@ -109,6 +109,10 @@ function! s:on_exit_show_branch(id, data, event) abort
|
|||||||
\ 'last_update_done' : localtime(),
|
\ 'last_update_done' : localtime(),
|
||||||
\ })
|
\ })
|
||||||
endif
|
endif
|
||||||
|
" when the pwd is same as current directory, redraw statueline
|
||||||
|
if pwd == getcwd()
|
||||||
|
redrawstatus
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
""
|
""
|
||||||
" return the current branch info. this function can be used in statusline.
|
" return the current branch info. this function can be used in statusline.
|
||||||
|
5
bundle/git.vim/autoload/git/checkout.vim
vendored
5
bundle/git.vim/autoload/git/checkout.vim
vendored
@ -1,4 +1,5 @@
|
|||||||
let s:JOB = SpaceVim#api#import('job')
|
let s:JOB = SpaceVim#api#import('job')
|
||||||
|
let s:NOTI = SpaceVim#api#import('notify')
|
||||||
|
|
||||||
function! git#checkout#run(args)
|
function! git#checkout#run(args)
|
||||||
|
|
||||||
@ -16,10 +17,10 @@ function! s:on_exit(id, data, event) abort
|
|||||||
call git#logger#debug('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'
|
call s:NOTI.notify('checkout done.')
|
||||||
call git#branch#detect()
|
call git#branch#detect()
|
||||||
else
|
else
|
||||||
echo 'failed!'
|
call s:NOTI.notify('checkout failed.', 'WarningMsg')
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user