mirror of
https://github.com/vim-airline/vim-airline-themes
synced 2025-01-05 13:09:50 +00:00
address startup and lazyredraw related issues (#10)
This commit is contained in:
parent
53b4491c78
commit
57b8157bed
@ -10,11 +10,11 @@ there's already [powerline][b], why yet another statusline?
|
||||
* it's small. i want the entire plugin to be less than 200 lines as a rule
|
||||
* it gets you 90% of the way there; in addition to all the standard goodies, it integrates with [vim-bufferline][f], [fugitive][d], and [syntastic][e]
|
||||
* it looks good with regular fonts, and provides configuration points so you can use unicode or powerline symbols
|
||||
* it's fast to load, taking only 0.5ms. by comparison, powerline needs 60ms on the same machine.
|
||||
* it's fast to load, taking roughly 1ms. by comparison, powerline needs 60ms on the same machine.
|
||||
|
||||
# why's it called airline?
|
||||
|
||||
i wrote this on an airplane, and since it's light as air it turned out to be a good name. thanks for flying vim!
|
||||
i wrote the initial version on an airplane, and since it's light as air it turned out to be a good name. thanks for flying vim!
|
||||
|
||||
# configuration
|
||||
|
||||
@ -27,8 +27,8 @@ i wrote this on an airplane, and since it's light as air it turned out to be a g
|
||||
* you can grab prepatched fonts at [powerline-fonts][c], or you can manually set the relevant `g:` variables
|
||||
2. there is a pause when leaving insert mode
|
||||
* you need to set `ttimeoutlen` to a low number; 50 is recommended
|
||||
3. the colors don't change
|
||||
* ensure that `set t_Co=256` is set in your vimrc
|
||||
3. the colors don't change properly
|
||||
* ensure you have 256 color mode enabed for terminal vim (`set t_Co=256`)
|
||||
4. you get the error `Unknown function: fugitive#head`
|
||||
* you are probably using version 1.2, which is very old...download v2 from the [project page][d].
|
||||
|
||||
|
@ -120,8 +120,11 @@ function! s:update_statusline(active)
|
||||
endfunction
|
||||
|
||||
function! AirlineModePrefix()
|
||||
let l:mode = mode()
|
||||
if !&lazyredraw
|
||||
redrawstatus
|
||||
endif
|
||||
|
||||
let l:mode = mode()
|
||||
call <sid>highlight('normal', ['statusline','statusline_nc','inactive','mode','mode_separator','info','info_separator','file'])
|
||||
|
||||
if l:mode ==# "i" || l:mode ==# "R"
|
||||
@ -139,12 +142,12 @@ endfunction
|
||||
augroup airline
|
||||
au!
|
||||
hi clear StatusLine | hi clear StatusLineNC
|
||||
autocmd ColorScheme * hi clear StatusLine | hi clear StatusLineNC
|
||||
autocmd ColorScheme * hi clear StatusLine | hi clear StatusLineNC | redrawstatus
|
||||
autocmd WinLeave * call <sid>update_statusline(0)
|
||||
autocmd VimEnter,WinEnter,BufWinEnter * call <sid>update_statusline(1)
|
||||
|
||||
" if you know why lazyredraw affects statusline rendering i'd love to know!
|
||||
if !&lazyredraw
|
||||
autocmd InsertLeave * :redrawstatus
|
||||
autocmd VimEnter,InsertLeave * :redrawstatus
|
||||
endif
|
||||
augroup END
|
||||
|
Loading…
Reference in New Issue
Block a user