Use <nomodeline> if possible in :doautocmd

prevents closing of folds on CursorHold autocommand
when skip_empty sections is true
This commit is contained in:
Christian Brabandt 2016-05-13 11:19:56 +02:00
parent 0d05196426
commit 46f854fc83
1 changed files with 5 additions and 1 deletions

View File

@ -119,7 +119,11 @@ function! s:airline_theme(...)
endfunction
function! s:airline_refresh()
silent doautocmd User AirlineBeforeRefresh
let nomodeline=''
if v:version > 703 || v:version == 703 && has("patch438")
let nomodeline = '<nomodeline>'
endif
exe printf("silent doautocmd %s User AirlineBeforeRefresh", nomodeline)
call airline#load_theme()
call airline#update_statusline()
endfunction