mirror of
https://github.com/vim-airline/vim-airline-themes.git
synced 2024-12-05 00:13:34 +08:00
use __accent to better differentiate between a real group.
This commit is contained in:
parent
41192a2a65
commit
474116461f
|
@ -24,7 +24,7 @@ function! s:prototype.add_section(group, contents)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let contents = []
|
let contents = []
|
||||||
let content_parts = split(a:contents, 'airline_accent')
|
let content_parts = split(a:contents, '__accent')
|
||||||
for cpart in content_parts
|
for cpart in content_parts
|
||||||
let accent = matchstr(cpart, '_\zs[^#]*\ze')
|
let accent = matchstr(cpart, '_\zs[^#]*\ze')
|
||||||
call airline#highlighter#add_accent(a:group, accent)
|
call airline#highlighter#add_accent(a:group, accent)
|
||||||
|
|
|
@ -68,7 +68,7 @@ function! airline#init#bootstrap()
|
||||||
\ 'accent': 'red',
|
\ 'accent': 'red',
|
||||||
\ })
|
\ })
|
||||||
call airline#parts#define_raw('file', '%f%m')
|
call airline#parts#define_raw('file', '%f%m')
|
||||||
call airline#parts#define_raw('linenr', (g:airline_symbols.linenr).' %#airline_accent_bold#%3l%#__restore__#')
|
call airline#parts#define_raw('linenr', (g:airline_symbols.linenr).' %#__accent_bold#%3l%#__restore__#')
|
||||||
call airline#parts#define_function('ffenc', 'airline#parts#ffenc')
|
call airline#parts#define_function('ffenc', 'airline#parts#ffenc')
|
||||||
call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic', 'whitespace'])
|
call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic', 'whitespace'])
|
||||||
endfunction
|
endfunction
|
||||||
|
|
|
@ -11,7 +11,7 @@ function! s:create(parts, append)
|
||||||
|
|
||||||
let val = ''
|
let val = ''
|
||||||
if exists('part.accent')
|
if exists('part.accent')
|
||||||
let val .= '%#airline_accent_'.(part.accent).'#'
|
let val .= '%#__accent_'.(part.accent).'#'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if exists('part.function')
|
if exists('part.function')
|
||||||
|
|
|
@ -40,13 +40,13 @@ describe 'active builder'
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should replace accent groups with the specified group'
|
it 'should replace accent groups with the specified group'
|
||||||
call s:builder.add_section('Normal', '%#airline_accent_foo#hello')
|
call s:builder.add_section('Normal', '%#__accent_foo#hello')
|
||||||
let stl = s:builder.build()
|
let stl = s:builder.build()
|
||||||
Expect stl == '%#Normal#%#Normal_foo#hello'
|
Expect stl == '%#Normal#%#Normal_foo#hello'
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should replace two accent groups with correct groups'
|
it 'should replace two accent groups with correct groups'
|
||||||
call s:builder.add_section('Normal', '%#airline_accent_foo#hello%#airline_accent_bar#world')
|
call s:builder.add_section('Normal', '%#__accent_foo#hello%#__accent_bar#world')
|
||||||
let stl = s:builder.build()
|
let stl = s:builder.build()
|
||||||
Expect stl =~ '%#Normal_foo#hello%#Normal_bar#world'
|
Expect stl =~ '%#Normal_foo#hello%#Normal_bar#world'
|
||||||
end
|
end
|
||||||
|
|
|
@ -28,7 +28,7 @@ describe 'init'
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'section c should be file'
|
it 'section c should be file'
|
||||||
Expect g:airline_section_c == '%<%f%m %#airline_accent_red#%{airline#util#wrap(airline#parts#readonly(),0)}%#__restore__#'
|
Expect g:airline_section_c == '%<%f%m %#__accent_red#%{airline#util#wrap(airline#parts#readonly(),0)}%#__restore__#'
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'section x should be filetype'
|
it 'section x should be filetype'
|
||||||
|
|
|
@ -32,7 +32,7 @@ describe 'section'
|
||||||
\ 'accent': 'red',
|
\ 'accent': 'red',
|
||||||
\ })
|
\ })
|
||||||
let s = airline#section#create(['hi'])
|
let s = airline#section#create(['hi'])
|
||||||
Expect s == '%#airline_accent_red#hello'
|
Expect s == '%#__accent_red#hello'
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should parse out a section from the distro'
|
it 'should parse out a section from the distro'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user