2013-08-20 16:18:01 +08:00
|
|
|
" MIT License. Copyright (c) 2013 Bailey Ling.
|
|
|
|
" vim: et ts=2 sts=2 sw=2
|
|
|
|
|
2013-08-20 20:11:38 +08:00
|
|
|
let s:symbol = get(g:, 'airline#extensions#readonly#symbol',
|
|
|
|
\ get(g:, 'airline_readonly_symbol', exists('g:airline_powerline_fonts') ? '' : 'RO'))
|
|
|
|
|
2013-08-20 16:18:01 +08:00
|
|
|
function! airline#extensions#readonly#get_mark()
|
2013-08-20 20:11:38 +08:00
|
|
|
return &ro ? s:symbol : ''
|
2013-08-20 16:18:01 +08:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! airline#extensions#readonly#init()
|
2013-08-21 00:13:08 +08:00
|
|
|
let g:airline_section_gutter = ' %{airline#extensions#readonly#get_mark()} '
|
2013-08-20 20:11:38 +08:00
|
|
|
\ .g:airline_section_gutter
|
2013-08-20 16:18:01 +08:00
|
|
|
endfunction
|
|
|
|
|