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:
parent
7d871137be
commit
4f95970228
@ -122,13 +122,13 @@ function! s:update_hg_branch()
|
||||
let file=expand('%:p')
|
||||
if !empty(stl) && get(b:, 'airline_do_mq_check', 1)
|
||||
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")
|
||||
call airline#async#nvim_get_mq_async(cmd, file)
|
||||
noa call airline#async#nvim_get_mq_async(cmd, file)
|
||||
else
|
||||
" remove \n at the end of the command
|
||||
let output=system(cmd)[0:-2]
|
||||
call airline#async#mq_output(output, file)
|
||||
noa call airline#async#mq_output(output, file)
|
||||
endif
|
||||
endif
|
||||
" 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
|
||||
" 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.
|
||||
call airline#async#vim_vcs_untracked(config, file)
|
||||
noa call airline#async#vim_vcs_untracked(config, file)
|
||||
else
|
||||
" 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
|
||||
endfor
|
||||
endfunction
|
||||
@ -242,7 +242,7 @@ function! airline#extensions#branch#head()
|
||||
|
||||
if empty(heads)
|
||||
if airline#util#has_vcscommand()
|
||||
call VCSCommandEnableBufferSetup()
|
||||
noa call VCSCommandEnableBufferSetup()
|
||||
if exists('b:VCSCommandBufferInfo')
|
||||
let b:airline_head = s:format_name(get(b:VCSCommandBufferInfo, 0, ''))
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user