mirror of
https://github.com/vim-airline/vim-airline.git
synced 2026-08-16 20:57:59 +08:00
optimize funcrefs for 7.4
This commit is contained in:
@@ -12,8 +12,21 @@ else
|
|||||||
endfunction
|
endfunction
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! airline#util#exec_funcrefs(list, break_early)
|
if v:version >= 704
|
||||||
" for 7.2; we cannot iterate list, hence why we use range()
|
function! airline#util#exec_funcrefs(list, break_early)
|
||||||
|
for Fn in a:list
|
||||||
|
if a:break_early
|
||||||
|
if Fn()
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
call Fn()
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
endfunction
|
||||||
|
else
|
||||||
|
function! airline#util#exec_funcrefs(list, break_early)
|
||||||
|
" for 7.2; we cannot iterate the list, hence why we use range()
|
||||||
" for 7.3-[97, 328]; we cannot reuse the variable, hence the {}
|
" for 7.3-[97, 328]; we cannot reuse the variable, hence the {}
|
||||||
for i in range(0, len(a:list) - 1)
|
for i in range(0, len(a:list) - 1)
|
||||||
let Fn{i} = a:list[i]
|
let Fn{i} = a:list[i]
|
||||||
@@ -26,5 +39,6 @@ function! airline#util#exec_funcrefs(list, break_early)
|
|||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
return 0
|
return 0
|
||||||
endfunction
|
endfunction
|
||||||
|
endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user