mirror of
https://github.com/vim-airline/vim-airline-themes.git
synced 2024-12-05 08:30:03 +08:00
Merge pull request #161 from itchyny/readonly_symbol
readonly mark is now a member of extensions
This commit is contained in:
commit
fad2c084e7
|
@ -52,8 +52,7 @@ function! airline#get_statusline(winnr, active)
|
|||
call builder.add_section('airline_a', s:get_section(a:winnr, 'a')
|
||||
\ .'%{g:airline_detect_paste && &paste ? g:airline_paste_symbol." " : ""}')
|
||||
call builder.add_section('airline_b', s:get_section(a:winnr, 'b'))
|
||||
call builder.add_section('airline_c', '%<'.s:get_section(a:winnr, 'c')
|
||||
\ .' %#airline_file#%{&ro ? g:airline_readonly_symbol : ""}')
|
||||
call builder.add_section('airline_c', '%<'.s:get_section(a:winnr, 'c'))
|
||||
else
|
||||
call builder.add_section('airline_c', '%f%m')
|
||||
endif
|
||||
|
|
|
@ -167,6 +167,10 @@ function! airline#extensions#load()
|
|||
call airline#extensions#whitespace#init()
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#readonly#enabled', 1)
|
||||
call airline#extensions#readonly#init()
|
||||
endif
|
||||
|
||||
if g:airline_detect_iminsert
|
||||
call airline#extensions#iminsert#init()
|
||||
endif
|
||||
|
|
11
autoload/airline/extensions/readonly.vim
Normal file
11
autoload/airline/extensions/readonly.vim
Normal 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
|
||||
|
Loading…
Reference in New Issue
Block a user