mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -610,3 +610,15 @@ function! s:suite.duplicated_type_both_nil_right_most()
|
||||
\ [[['filename'], ['y0', 'y1', 'y0', 'y1']], [[0], [1, 1, 1, 1]], ['0', 'custom', '1']])
|
||||
delfunction Custom
|
||||
endfunction
|
||||
|
||||
function! s:suite.dictionary_function()
|
||||
let g:lightline = { 'component_expand': { 'custom': 'g:lightline.Custom' } }
|
||||
function! g:lightline.Custom()
|
||||
return [ ['left'], ['middle'], ['right'] ]
|
||||
endfunction
|
||||
call lightline#init()
|
||||
call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
|
||||
\ [[['readonly', 'filename'], ['left', 'middle', 'right'], ['modified']], [[0, 0], [1, 1, 1], [0]], ['0', '1', '2', '3']])
|
||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
||||
\ [[['readonly', 'filename', 'left', 'middle', 'right', 'modified']], [[0, 0, 1, 1, 1, 0]], ['0', '1']])
|
||||
endfunction
|
||||
|
@ -177,6 +177,111 @@ function! s:suite.subseparator_component_function_7()
|
||||
delfunction Custom3
|
||||
endfunction
|
||||
|
||||
function! s:suite.subseparator_component_function_visible_condition_1()
|
||||
function! Custom1()
|
||||
return 'custom1'
|
||||
endfunction
|
||||
function! Custom2()
|
||||
return 'custom2'
|
||||
endfunction
|
||||
function! Custom3()
|
||||
return 'custom3'
|
||||
endfunction
|
||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom1': '1', 'custom2': '1', 'custom3': '1' } }
|
||||
call lightline#init()
|
||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
|
||||
endfunction
|
||||
|
||||
function! s:suite.subseparator_component_function_visible_condition_2()
|
||||
function! Custom1()
|
||||
return 'custom1'
|
||||
endfunction
|
||||
function! Custom2()
|
||||
return 'custom2'
|
||||
endfunction
|
||||
function! Custom3()
|
||||
return 'custom3'
|
||||
endfunction
|
||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom1': '0', 'custom2': '1', 'custom3': '1' } }
|
||||
call lightline#init()
|
||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
||||
endfunction
|
||||
|
||||
function! s:suite.subseparator_component_function_visible_condition_3()
|
||||
function! Custom1()
|
||||
return 'custom1'
|
||||
endfunction
|
||||
function! Custom2()
|
||||
return 'custom2'
|
||||
endfunction
|
||||
function! Custom3()
|
||||
return 'custom3'
|
||||
endfunction
|
||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom1': '1', 'custom2': '0', 'custom3': '1' } }
|
||||
call lightline#init()
|
||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
|
||||
endfunction
|
||||
|
||||
function! s:suite.subseparator_component_function_visible_condition_4()
|
||||
function! Custom1()
|
||||
return 'custom1'
|
||||
endfunction
|
||||
function! Custom2()
|
||||
return 'custom2'
|
||||
endfunction
|
||||
function! Custom3()
|
||||
return 'custom3'
|
||||
endfunction
|
||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom1': '1', 'custom2': '0', 'custom3': '0' } }
|
||||
call lightline#init()
|
||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
||||
endfunction
|
||||
|
||||
function! s:suite.subseparator_component_function_visible_condition_5()
|
||||
function! Custom1()
|
||||
return 'custom1'
|
||||
endfunction
|
||||
function! Custom2()
|
||||
return ''
|
||||
endfunction
|
||||
function! Custom3()
|
||||
return ''
|
||||
endfunction
|
||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom1': '0' } }
|
||||
call lightline#init()
|
||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
||||
endfunction
|
||||
|
||||
function! s:suite.subseparator_component_function_visible_condition_6()
|
||||
function! Custom1()
|
||||
return ''
|
||||
endfunction
|
||||
function! Custom2()
|
||||
return 'custom2'
|
||||
endfunction
|
||||
function! Custom3()
|
||||
return 'custom3'
|
||||
endfunction
|
||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom2': '1', 'custom3': '1' } }
|
||||
call lightline#init()
|
||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
|
||||
endfunction
|
||||
|
||||
function! s:suite.subseparator_component_function_visible_condition_7()
|
||||
function! Custom1()
|
||||
return 'custom1'
|
||||
endfunction
|
||||
function! Custom2()
|
||||
return ''
|
||||
endfunction
|
||||
function! Custom3()
|
||||
return 'custom3'
|
||||
endfunction
|
||||
let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' }, 'component_function_visible_condition': { 'custom3': '1' } }
|
||||
call lightline#init()
|
||||
call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
|
||||
endfunction
|
||||
|
||||
function! s:suite.subseparator_component_expand()
|
||||
function! Custom1()
|
||||
return 'custom1'
|
||||
|
Reference in New Issue
Block a user