mirror of
https://github.com/vim-airline/vim-airline.git
synced 2026-02-25 19:17:13 +08:00
Merge branch 'master' into dev
Conflicts: doc/airline.txt
This commit is contained in:
@@ -26,7 +26,6 @@ function! airline#add_inactive_statusline_func(name)
|
||||
endfunction
|
||||
|
||||
function! airline#load_theme()
|
||||
highlight! default link airline_warning WarningMsg
|
||||
call airline#highlighter#load_theme()
|
||||
call airline#extensions#load_theme()
|
||||
endfunction
|
||||
|
||||
@@ -23,14 +23,18 @@ function! s:get_section(winnr, key, ...)
|
||||
return empty(text) ? '' : prefix.text.suffix
|
||||
endfunction
|
||||
|
||||
function! s:build_sections(builder, keys, winnr)
|
||||
function! s:build_sections(builder, context, keys)
|
||||
for key in a:keys
|
||||
if key == 'warning' && !a:context.active
|
||||
continue
|
||||
endif
|
||||
|
||||
" i have no idea why the warning section needs special treatment, but it's
|
||||
" needed to prevent separators from showing up
|
||||
if key == 'warning'
|
||||
call a:builder.add_raw('%(')
|
||||
endif
|
||||
call a:builder.add_section('airline_'.key, s:get_section(a:winnr, key))
|
||||
call a:builder.add_section('airline_'.key, s:get_section(a:context.winnr, key))
|
||||
if key == 'warning'
|
||||
call a:builder.add_raw('%)')
|
||||
endif
|
||||
@@ -42,7 +46,7 @@ function! airline#extensions#default#apply(builder, context)
|
||||
let active = a:context.active
|
||||
|
||||
if airline#util#getwinvar(winnr, 'airline_render_left', active || (!active && !g:airline_inactive_collapse))
|
||||
call <sid>build_sections(a:builder, s:layout[0], winnr)
|
||||
call <sid>build_sections(a:builder, a:context, s:layout[0])
|
||||
else
|
||||
call a:builder.add_section('airline_a', '%f%m ')
|
||||
call a:builder.add_section('airline_c', '')
|
||||
@@ -51,7 +55,7 @@ function! airline#extensions#default#apply(builder, context)
|
||||
call a:builder.split(s:get_section(winnr, 'gutter', '', ''))
|
||||
|
||||
if airline#util#getwinvar(winnr, 'airline_render_right', 1)
|
||||
call <sid>build_sections(a:builder, s:layout[1], winnr)
|
||||
call <sid>build_sections(a:builder, a:context, s:layout[1])
|
||||
endif
|
||||
|
||||
return 1
|
||||
|
||||
@@ -10,14 +10,6 @@ function! s:init()
|
||||
let s:initialized = 1
|
||||
if get(g:, 'loaded_signify', 0)
|
||||
function! s:get_hunks()
|
||||
" this is a temporary fix (see #188)
|
||||
let fname = fnamemodify(bufname('%'), ':p')
|
||||
if has_key(g:sy, fname) && has_key(g:sy[fname], 'hunks')
|
||||
if len(g:sy[fname].hunks) == 0
|
||||
return [0, 0, 0]
|
||||
endif
|
||||
endif
|
||||
|
||||
let hunks = sy#repo#get_stats()
|
||||
if hunks[0] >= 0
|
||||
return hunks
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
function! airline#extensions#unite#apply(...)
|
||||
if &ft == 'unite'
|
||||
call a:1.add_section('airline_a', ' Unite ')
|
||||
call a:1.add_section('airline_b', ' %{unite#get_context().buffer_name} ')
|
||||
call a:1.add_section('airline_b', ' %{get(unite#get_context(), "buffer_name", "")} ')
|
||||
call a:1.add_section('airline_c', ' %{unite#get_status_string()} ')
|
||||
call a:1.split()
|
||||
call a:1.add_section('airline_y', ' %{unite#get_context().real_buffer_name} ')
|
||||
call a:1.add_section('airline_y', ' %{get(unite#get_context(), "real_buffer_name", "")} ')
|
||||
return 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -54,6 +54,12 @@ function! airline#themes#get_highlight2(fg, bg, ...)
|
||||
endfunction
|
||||
|
||||
function! airline#themes#patch(palette)
|
||||
for mode in keys(a:palette)
|
||||
if !has_key(a:palette[mode], 'airline_warning')
|
||||
let a:palette[mode]['airline_warning'] = [ '#000000', '#df5f00', 232, 166 ]
|
||||
endif
|
||||
endfor
|
||||
|
||||
" this is a pretty heavy handed, but it works...
|
||||
" basically, look for the 'airline_file' group and copy the bg
|
||||
" colors from 'airline_c' into it.
|
||||
|
||||
Reference in New Issue
Block a user