diff --git a/autoload/airline/extensions/readonly.vim b/autoload/airline/extensions/readonly.vim index bd14c8c3..44390306 100644 --- a/autoload/airline/extensions/readonly.vim +++ b/autoload/airline/extensions/readonly.vim @@ -1,11 +1,15 @@ " MIT License. Copyright (c) 2013 Bailey Ling. " vim: et ts=2 sts=2 sw=2 +let s:symbol = get(g:, 'airline#extensions#readonly#symbol', + \ get(g:, 'airline_readonly_symbol', exists('g:airline_powerline_fonts') ? '' : 'RO')) + function! airline#extensions#readonly#get_mark() - return &ro ? g:airline_readonly_symbol : '' + return &ro ? s:symbol : '' endfunction function! airline#extensions#readonly#init() - let g:airline_section_c .= '%{airline#extensions#readonly#get_mark()}' + let g:airline_section_gutter = '%{airline#extensions#readonly#get_mark()}' + \ .g:airline_section_gutter endfunction diff --git a/doc/airline.txt b/doc/airline.txt index 236205af..650ee91c 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -132,7 +132,7 @@ separators, as well as the powerline font glyths. let g:airline_right_sep = '' let g:airline_right_alt_sep = '' let g:airline#extensions#branch#symbol = ' ' - let g:airline_readonly_symbol = '' + let g:airline#extensions#readonly#symbol = '' let g:airline_linecolumn_prefix = ' ' " old vim-powerline symbols @@ -141,7 +141,7 @@ separators, as well as the powerline font glyths. let g:airline_right_sep = '⮂' let g:airline_right_alt_sep = '⮃' let g:airline#extensions#branch#symbol = '⭠' - let g:airline_readonly_symbol = '⭤' + let g:airline#extensions#readonly#symbol = '⭤' let g:airline_linecolumn_prefix = '⭡' < diff --git a/plugin/airline.vim b/plugin/airline.vim index 0b0bd304..ec15bef3 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -19,7 +19,6 @@ call s:check_defined('g:airline_right_alt_sep', exists('g:airline_powerline_font call s:check_defined('g:airline_detect_iminsert', 0) call s:check_defined('g:airline_detect_modified', 1) call s:check_defined('g:airline_detect_paste', 1) -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', (exists('g:airline_powerline_fonts') ? ' ' : '').'PASTE') call s:check_defined('g:airline_inactive_collapse', 1)