From 4f95970228a83fb494386a51091aec176525ccc9 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Mon, 11 Jun 2018 14:45:29 +0200 Subject: [PATCH] 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 --- autoload/airline/extensions/branch.vim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/autoload/airline/extensions/branch.vim b/autoload/airline/extensions/branch.vim index b4152b55..fcf4d3a7 100644 --- a/autoload/airline/extensions/branch.vim +++ b/autoload/airline/extensions/branch.vim @@ -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