make modified/paste detection an option

This commit is contained in:
Bailey Ling 2013-07-22 21:23:41 +00:00
parent fce0e3e8da
commit 221864cfdc
4 changed files with 16 additions and 4 deletions

View File

@ -21,7 +21,7 @@ What about [old powerline][a]?
* the old version still works well, but since it's deprecated new features won't get added
* it uses different font codes, which makes it incompatible with other powerline bindings in the same terminal (e.g. bash, zsh, tmux, etc.)
# Why's it called airline?
# Where did the name come from?
I wrote the initial version on an airplane, and since it's light as air it turned out to be a good name. Thanks for flying vim!

View File

@ -167,8 +167,8 @@ function! airline#update_highlight()
let l:mode = ['inactive']
endif
if &modified | call add(l:mode, 'modified') | endif
if &paste | call add(l:mode, 'paste') | endif
if g:airline_detect_modified && &modified | call add(l:mode, 'modified') | endif
if g:airline_detect_paste && &paste | call add(l:mode, 'paste') | endif
let mode_string = join(l:mode)
if get(w:, 'airline_lastmode', '') != mode_string

View File

@ -28,7 +28,7 @@ another statusline?
==============================================================================
NAME *airline-name*
Why is it named airline?
Where did the name come from?
I wrote this on an airplane, and since it's light as air it turned out to be a
good name :-)
@ -59,6 +59,16 @@ values):
let g:airline_enable_syntastic=1
<
* enable modified detection
>
let g:airline_detect_modified=1
<
* enable paste detection
>
let g:airline_detect_paste=1
<
* change the default theme
>
let g:airline_theme='dark'

View File

@ -15,6 +15,8 @@ call s:check_defined('g:airline_right_alt_sep', exists('g:airline_powerline_font
call s:check_defined('g:airline_enable_bufferline', 1)
call s:check_defined('g:airline_enable_fugitive', 1)
call s:check_defined('g:airline_enable_syntastic', 1)
call s:check_defined('g:airline_detect_modified', 1)
call s:check_defined('g:airline_detect_paste', 1)
call s:check_defined('g:airline_fugitive_prefix', exists('g:airline_powerline_fonts')?' ':'')
call s:check_defined('g:airline_readonly_symbol', exists('g:airline_powerline_fonts')?'':'RO')
call s:check_defined('g:airline_linecolumn_prefix', exists('g:airline_powerline_fonts')?' ':':')