readonly mark is now a member of extensions

This commit is contained in:
itchyny
2013-08-20 17:18:01 +09:00
parent fa62cbb5f6
commit 57cf78ba77
3 changed files with 16 additions and 2 deletions

View File

@@ -167,6 +167,10 @@ function! airline#extensions#load()
call airline#extensions#whitespace#init()
endif
if (get(g:, 'airline#extensions#readonly#enabled', 1) && get(g:, 'airline_detect_readonly', 1))
call airline#extensions#readonly#init()
endif
if g:airline_detect_iminsert
call airline#extensions#iminsert#init()
endif

View File

@@ -0,0 +1,11 @@
" MIT License. Copyright (c) 2013 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
function! airline#extensions#readonly#get_mark()
return &ro ? g:airline_readonly_symbol : ''
endfunction
function! airline#extensions#readonly#init()
let g:airline_section_c .= '%{airline#extensions#readonly#get_mark()}'
endfunction