mirror of
https://github.com/vim-airline/vim-airline.git
synced 2026-02-16 23:12:08 +08:00
clean up how symbols are defined.
This commit is contained in:
@@ -195,10 +195,6 @@ function! airline#extensions#load()
|
||||
endif
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#readonly#enabled', 1)
|
||||
call airline#extensions#readonly#init()
|
||||
endif
|
||||
|
||||
" load all other extensions not part of the default distribution
|
||||
for file in split(globpath(&rtp, "autoload/airline/extensions/*.vim"), "\n")
|
||||
" check to see that both the resolved and unresolved paths do not match
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
|
||||
let s:empty_message = get(g:, 'airline#extensions#branch#empty_message',
|
||||
\ get(g:, 'airline_branch_empty_message', ''))
|
||||
let s:symbol = get(g:, 'airline#extensions#branch#symbol',
|
||||
\ get(g:, 'airline_branch_prefix', get(g:, 'airline_powerline_fonts', 0) ? ' ' : ''))
|
||||
let s:symbol = g:airline_symbols.branch
|
||||
|
||||
let s:has_fugitive = exists('*fugitive#head')
|
||||
let s:has_fugitive_detect = exists('*fugitive#detect')
|
||||
@@ -28,7 +27,7 @@ function! airline#extensions#branch#get_head()
|
||||
endif
|
||||
endif
|
||||
|
||||
return empty(head) ? s:empty_message : s:symbol.head
|
||||
return empty(head) ? s:empty_message : s:symbol.' '.head
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#branch#init(ext)
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:symbol = get(g:, 'airline#extensions#readonly#symbol',
|
||||
\ get(g:, 'airline_readonly_symbol', get(g:, 'airline_powerline_fonts', 0) ? '' : 'RO'))
|
||||
|
||||
function! airline#extensions#readonly#get_mark()
|
||||
return &ro ? s:symbol : ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#readonly#init()
|
||||
let g:airline_section_gutter = ' %#airline_file#%{airline#extensions#readonly#get_mark()} '
|
||||
\ .g:airline_section_gutter
|
||||
endfunction
|
||||
|
||||
@@ -10,9 +10,7 @@ else
|
||||
let s:show_message = get(g:, 'airline#extensions#whitespace#show_message', 1)
|
||||
endif
|
||||
|
||||
let s:symbol = get(g:, 'airline#extensions#whitespace#symbol',
|
||||
\ get(g:, 'airline_whitespace_symbol', get(g:, 'airline_powerline_fonts', 0) ? '✹' : '!'))
|
||||
|
||||
let s:symbol = g:airline_symbols.whitespace
|
||||
let s:checks = get(g:, 'airline#extensions#whitespace#checks', ['indent', 'trailing'])
|
||||
|
||||
let s:trailing_format = get(g:, 'airline#extensions#whitespace#trailing_format', 'trailing[%s]')
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let g:airline#fragments#symbols = get(g:, 'airline#fragments#symbols', {})
|
||||
call extend(g:airline#fragments#symbols, {
|
||||
\ 'paste': get(g:, 'airline_paste_symbol', g:airline_left_alt_sep.' PASTE')
|
||||
\ }, 'keep')
|
||||
|
||||
function! airline#fragments#get_paste()
|
||||
return g:airline_detect_paste && &paste ? ' '.g:airline#fragments#symbols.paste : ''
|
||||
return g:airline_detect_paste && &paste ? ' '.g:airline_symbols.paste : ''
|
||||
endfunction
|
||||
|
||||
function! airline#fragments#get_iminsert()
|
||||
@@ -17,3 +12,7 @@ function! airline#fragments#get_iminsert()
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#fragments#get_readonly()
|
||||
return &readonly ? g:airline_symbols.readonly : ''
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user