mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-13 10:15:41 +08:00
fix(git): fix Git push
command
This commit is contained in:
parent
f9c0889a3b
commit
6aa0877e0c
9
bundle/git.vim/autoload/git/push.vim
vendored
9
bundle/git.vim/autoload/git/push.vim
vendored
@ -10,6 +10,7 @@ let s:NOTI = SpaceVim#api#import('notify')
|
|||||||
|
|
||||||
function! git#push#run(...) abort
|
function! git#push#run(...) abort
|
||||||
|
|
||||||
|
let s:NOTI.notify_max_width = float2nr( &columns * 0.3)
|
||||||
let cmd = ['git', 'push']
|
let cmd = ['git', 'push']
|
||||||
if len(a:1) > 0
|
if len(a:1) > 0
|
||||||
let cmd += a:1
|
let cmd += a:1
|
||||||
@ -23,14 +24,15 @@ function! git#push#run(...) abort
|
|||||||
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_exit(...) abort
|
function! s:on_exit(id, data, event) abort
|
||||||
let data = get(a:000, 2)
|
if a:data != 0
|
||||||
if data != 0
|
|
||||||
for line in s:std_data.stderr
|
for line in s:std_data.stderr
|
||||||
|
let s:NOTI.notify_max_width = max([strwidth(line) + 5, s:NOTI.notify_max_width])
|
||||||
call s:NOTI.notify(line, 'WarningMsg')
|
call s:NOTI.notify(line, 'WarningMsg')
|
||||||
endfor
|
endfor
|
||||||
else
|
else
|
||||||
for line in s:std_data.stderr
|
for line in s:std_data.stderr
|
||||||
|
let s:NOTI.notify_max_width = max([strwidth(line) + 5, s:NOTI.notify_max_width])
|
||||||
call s:NOTI.notify(line)
|
call s:NOTI.notify(line)
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
@ -39,6 +41,7 @@ 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)')
|
||||||
|
let s:NOTI.notify_max_width = max([strwidth(line) + 5, s:NOTI.notify_max_width])
|
||||||
call s:NOTI.notify(line, 'Normal')
|
call s:NOTI.notify(line, 'Normal')
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user