implement paste indicator. resolves #18

This commit is contained in:
Bailey Ling 2013-07-06 18:22:34 +00:00
parent 47425f9b4f
commit e89e6ad27b
2 changed files with 7 additions and 1 deletions

View File

@ -97,6 +97,7 @@ well as the powerline font glyths
let g:airline_linecolumn_prefix = '␤ '
let g:airline_linecolumn_prefix = '¶ '
let g:airline_fugitive_prefix = '⎇ '
let g:airline_paste_symbol = 'ρ'
" powerline symbols
let g:airline_left_sep = ''

View File

@ -16,8 +16,10 @@ call s:check_defined('g:airline_enable_syntastic', 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')?' ':':')
call s:check_defined('g:airline_paste_symbol', 'PASTE')
call s:check_defined('g:airline_theme', 'dark')
call s:check_defined('g:airline_modified_detection', 1)
call s:check_defined('g:airline_paste_detection', 1)
call s:check_defined('g:airline_exclude_filenames', ['DebuggerWatch','DebuggerStack','DebuggerStatus'])
call s:check_defined('g:airline_exclude_filetypes', ['qf','netrw','diff','undotree','gundo','nerdtree','tagbar'])
@ -114,7 +116,7 @@ function! s:update_statusline(active)
let sl = l:mode_color
let sl.= a:active
\ ? '%{AirlineUpdateHighlight()} '.g:airline_section_a.' '.l:mode_sep_color
\ ? '%{AirlineUpdateHighlight()} '.g:airline_section_a.' %{&paste ? g:airline_paste_symbol." " : ""}'.l:mode_sep_color
\ : ' %#Al9#'
let sl.='%{g:airline_left_sep}'.l:info_color
let sl.=' '.g:airline_section_b.' '
@ -147,6 +149,9 @@ function! AirlineUpdateHighlight()
if g:airline_modified_detection && &modified
call add(l:mode, 'modified')
endif
if g:airline_paste_detection && &paste
call add(l:mode, 'paste')
endif
if s:lastmode != l:mode
call <sid>highlight(l:mode)