mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-02 20:20: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(),
|
||||
\ })
|
||||
endif
|
||||
" when the pwd is same as current directory, redraw statueline
|
||||
if pwd == getcwd()
|
||||
redrawstatus
|
||||
endif
|
||||
endfunction
|
||||
""
|
||||
" 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:NOTI = SpaceVim#api#import('notify')
|
||||
|
||||
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))
|
||||
if a:data ==# 0
|
||||
silent! checktime
|
||||
echo 'checkout done'
|
||||
call s:NOTI.notify('checkout done.')
|
||||
call git#branch#detect()
|
||||
else
|
||||
echo 'failed!'
|
||||
call s:NOTI.notify('checkout failed.', 'WarningMsg')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user