mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-30 16:14:22 +08:00
restore highlight group with accents for all types of parts. resolves #272.
This commit is contained in:
@@ -4,15 +4,18 @@
|
||||
call airline#init#bootstrap()
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
function! s:wrap_accent(part, value)
|
||||
if exists('a:part.accent')
|
||||
return '%#__accent_'.(a:part.accent).'#'.a:value.'%#__restore__#'
|
||||
endif
|
||||
return a:value
|
||||
endfunction
|
||||
|
||||
function! s:create(parts, append)
|
||||
let _ = ''
|
||||
for idx in range(len(a:parts))
|
||||
let part = airline#parts#get(a:parts[idx])
|
||||
|
||||
let val = ''
|
||||
if exists('part.accent')
|
||||
let val .= '%#__accent_'.(part.accent).'#'
|
||||
endif
|
||||
|
||||
if exists('part.function')
|
||||
let func = (part.function).'()'
|
||||
@@ -26,10 +29,10 @@ function! s:create(parts, append)
|
||||
let val = s:spc.g:airline_right_alt_sep.s:spc.val
|
||||
endif
|
||||
if exists('part.raw')
|
||||
let _ .= val.(part.raw)
|
||||
let _ .= s:wrap_accent(part, val.(part.raw))
|
||||
continue
|
||||
else
|
||||
let _ .= val.a:parts[idx]
|
||||
let _ .= s:wrap_accent(part, val.a:parts[idx])
|
||||
continue
|
||||
endif
|
||||
endif
|
||||
@@ -49,10 +52,7 @@ function! s:create(parts, append)
|
||||
let partval = substitute(partval, '}', ' : ""}', '')
|
||||
endif
|
||||
|
||||
let val .= partval
|
||||
if exists('part.accent')
|
||||
let val .= '%#__restore__#'
|
||||
endif
|
||||
let val .= s:wrap_accent(part, partval)
|
||||
let _ .= val
|
||||
endfor
|
||||
return _
|
||||
|
||||
Reference in New Issue
Block a user