branch: do not show errors for mq extensions

skip anything that matches abort

e.g. running hg qtop with Vims path outside of the repository returns
something like "abort: no repository found in ..."
in that case, do not show anything.
This commit is contained in:
Christian Brabandt 2017-09-22 21:39:17 +02:00
parent 9f186d899a
commit 031cb31056
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
1 changed files with 3 additions and 1 deletions

View File

@ -14,11 +14,13 @@ function! s:untracked_output(dict, buf)
endif
endfunction
" also called from branch extension (for non-async vims)
function! airline#async#mq_output(buf, file)
let buf=a:buf
if !empty(a:buf)
if a:buf =~# 'no patches applied' ||
\ a:buf =~# "unknown command 'qtop'"
\ a:buf =~# "unknown command 'qtop'" ||
\ a:buf =~# "abort"
let buf = ''
elseif exists("b:mq") && b:mq isnot# buf
" make sure, statusline is updated