vim9: Needs at least version 8.2.22844

This commit is contained in:
Christian Brabandt 2021-06-07 13:44:18 +02:00
parent 82b1b2e876
commit 49cdcb7b3e
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
6 changed files with 12 additions and 5 deletions

View File

@ -44,7 +44,7 @@ function! airline#extensions#tabline#add_tab_label(dict)
endfunction endfunction
if !exists(":def") || (exists(":def") && get(g:, "airline_experimental", 0) == 0) if !exists(":def") || !airline#util#has_vim9_script()
" Legacy Vim Script Implementation " Legacy Vim Script Implementation

View File

@ -3,7 +3,7 @@
scriptencoding utf-8 scriptencoding utf-8
if !exists(":def") || (exists(":def") && get(g:, "airline_experimental", 0) == 0) if !exists(":def") || !airline#util#has_vim9_script()
function! airline#extensions#tabline#formatters#default#format(bufnr, buffers) function! airline#extensions#tabline#formatters#default#format(bufnr, buffers)
let fnametruncate = get(g:, 'airline#extensions#tabline#fnametruncate', 0) let fnametruncate = get(g:, 'airline#extensions#tabline#fnametruncate', 0)
let fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.') let fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.')

View File

@ -13,7 +13,7 @@ let s:separators = {}
let s:accents = {} let s:accents = {}
let s:hl_groups = {} let s:hl_groups = {}
if !exists(":def") || (exists(":def") && get(g:, "airline_experimental", 0) == 0) if !exists(":def") || !airline#util#has_vim9_script()
" Legacy Vimscript implementation " Legacy Vimscript implementation
function! s:gui2cui(rgb, fallback) abort function! s:gui2cui(rgb, fallback) abort

View File

@ -41,7 +41,7 @@ let s:basic16 = [
\ [ 0xFF, 0xFF, 0xFF ] \ [ 0xFF, 0xFF, 0xFF ]
\ ] \ ]
if !exists(":def") || (exists(":def") && get(g:, "airline_experimental", 0) == 0) if !exists(":def") || !airline#util#has_vim9_script()
function! airline#msdos#round_msdos_colors(rgblist) function! airline#msdos#round_msdos_colors(rgblist)
" Check for values from MSDOS 16 color terminal " Check for values from MSDOS 16 color terminal

View File

@ -3,7 +3,7 @@
scriptencoding utf-8 scriptencoding utf-8
if !exists(":def") || (exists(":def") && get(g:, "airline_experimental", 0) == 0) if !exists(":def") || !airline#util#has_vim9_script()
" Legacy Vim Script Implementation " Legacy Vim Script Implementation

View File

@ -214,3 +214,10 @@ function! airline#util#try_focusgained()
return dt >= 1 return dt >= 1
endfunction endfunction
function! airline#util#has_vim9_script()
" Returns true, if Vim is new enough to understand vim9 script
return (exists(":def") &&
\ v:versionlong >= 8022844 &&
\ get(g:, "airline_experimental", 0))
endfunction