mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-26 02:09:48 +08:00
miscellaneous minor changes
This commit is contained in:
parent
6e515a4627
commit
c017c9fbb3
|
@ -21,8 +21,8 @@ function! airline#exec_highlight(group, colors)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! airline#reload_highlight()
|
function! airline#reload_highlight()
|
||||||
call airline#highlight(['inactive'])
|
call s:highlight(['inactive'])
|
||||||
call airline#highlight(['normal'])
|
call s:highlight(['normal'])
|
||||||
call airline#extensions#load_theme()
|
call airline#extensions#load_theme()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -32,10 +32,10 @@ function! airline#load_theme(name)
|
||||||
let w:airline_lastmode = ''
|
let w:airline_lastmode = ''
|
||||||
call airline#update_statusline()
|
call airline#update_statusline()
|
||||||
call airline#reload_highlight()
|
call airline#reload_highlight()
|
||||||
call airline#update_highlight()
|
call airline#check_mode()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! airline#highlight(modes)
|
function! s:highlight(modes)
|
||||||
" draw the base mode, followed by any overrides
|
" draw the base mode, followed by any overrides
|
||||||
let mapped = map(a:modes, 'v:val == a:modes[0] ? v:val : a:modes[0]."_".v:val')
|
let mapped = map(a:modes, 'v:val == a:modes[0] ? v:val : a:modes[0]."_".v:val')
|
||||||
for mode in mapped
|
for mode in mapped
|
||||||
|
@ -108,7 +108,7 @@ function! airline#update_statusline()
|
||||||
call setwinvar(winnr(), '&statusline', airline#get_statusline(winnr(), 1))
|
call setwinvar(winnr(), '&statusline', airline#get_statusline(winnr(), 1))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! airline#update_highlight()
|
function! airline#check_mode()
|
||||||
if get(w:, 'airline_active', 1)
|
if get(w:, 'airline_active', 1)
|
||||||
let l:m = mode()
|
let l:m = mode()
|
||||||
if l:m ==# "i"
|
if l:m ==# "i"
|
||||||
|
@ -131,7 +131,7 @@ function! airline#update_highlight()
|
||||||
|
|
||||||
let mode_string = join(l:mode)
|
let mode_string = join(l:mode)
|
||||||
if get(w:, 'airline_lastmode', '') != mode_string
|
if get(w:, 'airline_lastmode', '') != mode_string
|
||||||
call airline#highlight(l:mode)
|
call s:highlight(l:mode)
|
||||||
let w:airline_lastmode = mode_string
|
let w:airline_lastmode = mode_string
|
||||||
endif
|
endif
|
||||||
return ''
|
return ''
|
||||||
|
|
|
@ -29,7 +29,7 @@ function! airline#builder#new(active)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! builder.build()
|
function! builder.build()
|
||||||
let line = '%{airline#update_highlight()}'
|
let line = '%{airline#check_mode()}'
|
||||||
let side = 0
|
let side = 0
|
||||||
let prev_group = ''
|
let prev_group = ''
|
||||||
let separator_groups = []
|
let separator_groups = []
|
||||||
|
|
|
@ -18,7 +18,7 @@ endfunction
|
||||||
|
|
||||||
function! airline#extensions#bufferline#init(ext)
|
function! airline#extensions#bufferline#init(ext)
|
||||||
highlight AlBl_active gui=bold cterm=bold term=bold
|
highlight AlBl_active gui=bold cterm=bold term=bold
|
||||||
highlight link AlBl_inactive Al6
|
highlight link AlBl_inactive airline_c
|
||||||
let g:bufferline_inactive_highlight = 'AlBl_inactive'
|
let g:bufferline_inactive_highlight = 'AlBl_inactive'
|
||||||
let g:bufferline_active_highlight = 'AlBl_active'
|
let g:bufferline_active_highlight = 'AlBl_active'
|
||||||
let g:bufferline_active_buffer_left = ''
|
let g:bufferline_active_buffer_left = ''
|
||||||
|
|
|
@ -5,7 +5,7 @@ if !exists('g:airline#extensions#csv#column_display')
|
||||||
let g:airline#extensions#csv#column_display = 'Number'
|
let g:airline#extensions#csv#column_display = 'Number'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! airline#extensions#csv#get_statusline()
|
function! airline#extensions#csv#get_column()
|
||||||
if exists('*CSV_WCol')
|
if exists('*CSV_WCol')
|
||||||
if g:airline#extensions#csv#column_display ==# 'Name'
|
if g:airline#extensions#csv#column_display ==# 'Name'
|
||||||
return '['.CSV_WCol('Name').CSV_WCol().']'
|
return '['.CSV_WCol('Name').CSV_WCol().']'
|
||||||
|
@ -23,7 +23,7 @@ function! airline#extensions#csv#apply()
|
||||||
endif
|
endif
|
||||||
let w:airline_section_gutter =
|
let w:airline_section_gutter =
|
||||||
\ g:airline_left_alt_sep
|
\ g:airline_left_alt_sep
|
||||||
\ .' %{airline#extensions#csv#get_statusline()}'
|
\ .' %{airline#extensions#csv#get_column()}'
|
||||||
\ .w:airline_section_gutter
|
\ .w:airline_section_gutter
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
|
@ -46,7 +46,7 @@ call s:check_defined('g:airline_mode_map', {
|
||||||
\ 'R' : 'REPLACE',
|
\ 'R' : 'REPLACE',
|
||||||
\ 'v' : 'VISUAL',
|
\ 'v' : 'VISUAL',
|
||||||
\ 'V' : 'V-LINE',
|
\ 'V' : 'V-LINE',
|
||||||
\ 'c' : 'CMD ',
|
\ 'c' : 'COMMAND',
|
||||||
\ '' : 'V-BLOCK',
|
\ '' : 'V-BLOCK',
|
||||||
\ 's' : 'SELECT',
|
\ 's' : 'SELECT',
|
||||||
\ 'S' : 'S-LINE',
|
\ 'S' : 'S-LINE',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user