From bfcece76c982279c09daf176182addcd19872209 Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Sat, 10 May 2014 14:41:21 +0000 Subject: [PATCH] add readonly mode so it can be themed independently. resolves #510 --- autoload/airline.vim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/autoload/airline.vim b/autoload/airline.vim index de66fbac..b4a88817 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -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)