basic working independent inactive modified highlights.
This commit is contained in:
parent
e1be8ff22f
commit
01d742794f
@ -66,7 +66,7 @@ endfunction
|
||||
function! airline#update_statusline()
|
||||
for nr in filter(range(1, winnr('$')), 'v:val != winnr()')
|
||||
call setwinvar(nr, 'airline_active', 0)
|
||||
let context = { 'winnr': nr, 'active': 0 }
|
||||
let context = { 'winnr': nr, 'active': 0, 'bufnr': winbufnr(nr) }
|
||||
call s:invoke_funcrefs(context, s:inactive_funcrefs)
|
||||
endfor
|
||||
|
||||
@ -77,7 +77,7 @@ function! airline#update_statusline()
|
||||
endfor
|
||||
|
||||
let w:airline_active = 1
|
||||
let context = { 'winnr': winnr(), 'active': 1 }
|
||||
let context = { 'winnr': winnr(), 'active': 1, 'bufnr': winbufnr(winnr()) }
|
||||
call s:invoke_funcrefs(context, g:airline_statusline_funcrefs)
|
||||
endfunction
|
||||
|
||||
@ -96,10 +96,12 @@ function! s:invoke_funcrefs(context, funcrefs)
|
||||
endfunction
|
||||
|
||||
function! airline#statusline(winnr)
|
||||
return '%{airline#check_mode()}'.s:contexts[a:winnr].line
|
||||
return '%{airline#check_mode('.a:winnr.')}'.s:contexts[a:winnr].line
|
||||
endfunction
|
||||
|
||||
function! airline#check_mode()
|
||||
function! airline#check_mode(winnr)
|
||||
let context = s:contexts[a:winnr]
|
||||
|
||||
if get(w:, 'airline_active', 1)
|
||||
let l:m = mode()
|
||||
if l:m ==# "i"
|
||||
@ -117,9 +119,23 @@ function! airline#check_mode()
|
||||
let w:airline_current_mode = get(g:airline_mode_map, '__')
|
||||
endif
|
||||
|
||||
if g:airline_detect_modified && &modified
|
||||
call add(l:mode, 'modified')
|
||||
if g:airline_detect_modified
|
||||
if &modified
|
||||
call add(l:mode, 'modified')
|
||||
let colors = g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_b
|
||||
else
|
||||
let colors = g:airline#themes#{g:airline_theme}#palette.inactive.airline_b
|
||||
endif
|
||||
|
||||
for winnr in range(1, winnr('$'))
|
||||
if winnr != a:winnr
|
||||
\ && has_key(s:contexts, winnr)
|
||||
\ && s:contexts[winnr].bufnr == context.bufnr
|
||||
call airline#highlighter#exec('airline_b'.(context.bufnr).'_inactive', colors)
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
if g:airline_detect_paste && &paste
|
||||
call add(l:mode, 'paste')
|
||||
endif
|
||||
|
@ -48,7 +48,7 @@ function! airline#extensions#default#apply(builder, context)
|
||||
if airline#util#getwinvar(winnr, 'airline_render_left', active || (!active && !g:airline_inactive_collapse))
|
||||
call <sid>build_sections(a:builder, a:context, s:layout[0])
|
||||
else
|
||||
call a:builder.add_section('airline_b', ' %f%m ')
|
||||
call a:builder.add_section('airline_b'.(a:context.bufnr), ' %f%m ')
|
||||
call a:builder.add_section('airline_c', '')
|
||||
endif
|
||||
|
||||
|
@ -84,6 +84,9 @@ let s:IA1 = [ '#4e4e4e' , '#1c1c1c' , 239 , 234 , '' ]
|
||||
let s:IA2 = [ '#4e4e4e' , '#262626' , 239 , 235 , '' ]
|
||||
let s:IA3 = [ '#4e4e4e' , '#303030' , 239 , 236 , '' ]
|
||||
let g:airline#themes#dark#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3, s:file)
|
||||
let g:airline#themes#dark#palette.inactive_modified = {
|
||||
\ 'airline_b': [ '#875faf' , '' , 97 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Here we define the color map for ctrlp. We check for the g:loaded_ctrlp
|
||||
|
Loading…
Reference in New Issue
Block a user