add readonly mode so it can be themed independently. resolves #510

This commit is contained in:
Bailey Ling 2014-05-10 14:41:21 +00:00
parent c5347b2f03
commit bfcece76c9
1 changed files with 6 additions and 4 deletions

View File

@ -148,16 +148,18 @@ function! airline#check_mode(winnr)
let w:airline_current_mode = get(g:airline_mode_map, '__')
endif
if g:airline_detect_modified
if &modified
call add(l:mode, 'modified')
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
if &readonly
call add(l:mode, 'readonly')
endif
let mode_string = join(l:mode)
if get(w:, 'airline_lastmode', '') != mode_string
call airline#highlighter#highlight_modified_inactive(context.bufnr)