mirror of
https://github.com/vim-airline/vim-airline.git
synced 2026-03-02 21:37:18 +08:00
Fix highlighting problems with Vim
1) Make sure airline_error and airline_warning highlighting are different, so that the correct separator will be drawn. This fixes #982. 2) allow to deactivate %(%) to workaround a vim bug, that may cause leaking of colors from one section to the next and adding additional spaces. This needs to be fixed upstream: https://groups.google.com/d/msg/vim_dev/sb1jmVirXPU/mPhvDnZ-CwAJ Possibly, also related to neovim/neovim#4147 Use `:let airline#extensions#default#section_use_groupitems = 0` to disable grouping of statusline items
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
" MIT License. Copyright (c) 2013-2016 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:section_use_groups = get(g:, 'airline#extensions#default#section_use_groupitems', 1)
|
||||
let s:section_truncate_width = get(g:, 'airline#extensions#default#section_truncate_width', {
|
||||
\ 'b': 79,
|
||||
\ 'x': 60,
|
||||
@@ -35,7 +36,10 @@ function! s:build_sections(builder, context, keys)
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
if v:version >= 704 || (v:version >= 703 && has('patch81'))
|
||||
" There still is a highlighting bug when using groups %(%) in the statusline,
|
||||
" deactivate it, until this is properly fixed:
|
||||
" https://groups.google.com/d/msg/vim_dev/sb1jmVirXPU/mPhvDnZ-CwAJ
|
||||
if s:section_use_groups && (v:version >= 704 || (v:version >= 703 && has('patch81')))
|
||||
function s:add_section(builder, context, key)
|
||||
" i have no idea why the warning section needs special treatment, but it's
|
||||
" needed to prevent separators from showing up
|
||||
|
||||
Reference in New Issue
Block a user