Do not clear intro screen
if airline is initialized too early and some :hi commands are run, this will force a redraw in Vim which will result in the intro screen being cleared. Currently, this does not work for gvim, not sure why. closes #1476 (well only partly, until i have discovered, why for gvim it doesn't work).
This commit is contained in:
parent
87cdf8f6c4
commit
7d082c03b2
@ -143,6 +143,11 @@ function! airline#statusline(winnr)
|
||||
endfunction
|
||||
|
||||
function! airline#check_mode(winnr)
|
||||
if !exists("s:airline_run")
|
||||
let s:airline_run = 0
|
||||
endif
|
||||
let s:airline_run += 1
|
||||
|
||||
let context = s:contexts[a:winnr]
|
||||
|
||||
if get(w:, 'airline_active', 1)
|
||||
@ -185,6 +190,13 @@ function! airline#check_mode(winnr)
|
||||
endif
|
||||
|
||||
let mode_string = join(l:mode)
|
||||
if s:airline_run < 3
|
||||
" skip this round.
|
||||
" When this function is run too early after startup,
|
||||
" it forces a redraw by vim which will remove the intro screen.
|
||||
let w:airline_lastmode = mode_string
|
||||
return ''
|
||||
endif
|
||||
if get(w:, 'airline_lastmode', '') != mode_string
|
||||
call airline#highlighter#highlight_modified_inactive(context.bufnr)
|
||||
call airline#highlighter#highlight(l:mode, context.bufnr)
|
||||
|
Loading…
Reference in New Issue
Block a user