branch: use :noa before calling async func

for some reasons, calling async functions might cause an error, if a
SourcePre command has been defined. So explicitly call the functions
using `:noa` modifier to prevent triggering the SourcePre autocommand.

fixes #1742
This commit is contained in:
Christian Brabandt 2018-06-11 14:45:29 +02:00
parent 7d871137be
commit 4f95970228
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -122,13 +122,13 @@ function! s:update_hg_branch()
let file=expand('%:p') let file=expand('%:p')
if !empty(stl) && get(b:, 'airline_do_mq_check', 1) if !empty(stl) && get(b:, 'airline_do_mq_check', 1)
if g:airline#init#vim_async if g:airline#init#vim_async
call airline#async#get_mq_async(cmd, file) noa call airline#async#get_mq_async(cmd, file)
elseif has("nvim") elseif has("nvim")
call airline#async#nvim_get_mq_async(cmd, file) noa call airline#async#nvim_get_mq_async(cmd, file)
else else
" remove \n at the end of the command " remove \n at the end of the command
let output=system(cmd)[0:-2] let output=system(cmd)[0:-2]
call airline#async#mq_output(output, file) noa call airline#async#mq_output(output, file)
endif endif
endif endif
" do not do mq check anymore " do not do mq check anymore
@ -199,10 +199,10 @@ function! s:update_untracked()
" invalidated again before s:update_untracked is called, then we lose the " invalidated again before s:update_untracked is called, then we lose the
" result of the previous call, i.e. the head string is not updated. It " result of the previous call, i.e. the head string is not updated. It
" doesn't happen often in practice, so we let it be. " doesn't happen often in practice, so we let it be.
call airline#async#vim_vcs_untracked(config, file) noa call airline#async#vim_vcs_untracked(config, file)
else else
" nvim async or vim without job-feature " nvim async or vim without job-feature
call airline#async#nvim_vcs_untracked(config, file, vcs) noa call airline#async#nvim_vcs_untracked(config, file, vcs)
endif endif
endfor endfor
endfunction endfunction
@ -242,7 +242,7 @@ function! airline#extensions#branch#head()
if empty(heads) if empty(heads)
if airline#util#has_vcscommand() if airline#util#has_vcscommand()
call VCSCommandEnableBufferSetup() noa call VCSCommandEnableBufferSetup()
if exists('b:VCSCommandBufferInfo') if exists('b:VCSCommandBufferInfo')
let b:airline_head = s:format_name(get(b:VCSCommandBufferInfo, 0, '')) let b:airline_head = s:format_name(get(b:VCSCommandBufferInfo, 0, ''))
endif endif