From 221864cfdc461546d0ae0b84edb46095d878ade8 Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Mon, 22 Jul 2013 21:23:41 +0000 Subject: [PATCH] make modified/paste detection an option --- README.md | 2 +- autoload/airline.vim | 4 ++-- doc/airline.txt | 12 +++++++++++- plugin/airline.vim | 2 ++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 93567ef2..1f01dd16 100644 --- a/README.md +++ b/README.md @@ -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! diff --git a/autoload/airline.vim b/autoload/airline.vim index 6db2eaed..e77e13b8 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -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 diff --git a/doc/airline.txt b/doc/airline.txt index cda16926..8d364f57 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -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' diff --git a/plugin/airline.vim b/plugin/airline.vim index cc714fe4..f0e044d8 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -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')?' ':':')