mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-22 09:22:53 +08:00
[add] winwidth's test
This commit is contained in:
parent
ab4962b838
commit
51c79f61f4
|
@ -16,7 +16,7 @@ let s:focusgained_ignore_time = 0
|
|||
" TODO: Try to cache winwidth(0) function
|
||||
" e.g. store winwidth per window and access that, only update it, if the size
|
||||
" actually changed.
|
||||
function! airline#util#winwidth(...)
|
||||
function! airline#util#winwidth(...) abort
|
||||
let nr = get(a:000, 0, 0)
|
||||
if get(g:, 'airline_statusline_ontop', 0)
|
||||
return &columns
|
||||
|
|
14
t/util.vim
14
t/util.vim
|
@ -20,6 +20,20 @@ describe 'util'
|
|||
Expect airline#util#append('1', 0) == ' 1'
|
||||
end
|
||||
|
||||
it 'should be same &columns'
|
||||
let g:airline_statusline_ontop = 1
|
||||
Expect airline#util#winwidth() == &columns
|
||||
end
|
||||
|
||||
it 'should be same winwidth(0)'
|
||||
let g:airline_statusline_ontop = 0
|
||||
Expect airline#util#winwidth() == winwidth(0)
|
||||
end
|
||||
|
||||
it 'should be same winwidth(30)'
|
||||
Expect airline#util#winwidth(30, 0) == winwidth(30)
|
||||
end
|
||||
|
||||
it 'has prepend wrapper function'
|
||||
Expect airline#util#prepend('', 0) == ''
|
||||
Expect airline#util#prepend('1', 0) == '1 '
|
||||
|
|
Loading…
Reference in New Issue
Block a user