pass context into the builder.

This commit is contained in:
Bailey Ling
2013-08-24 03:18:43 +00:00
parent 2cfab73f1b
commit 3bb451f1f4
3 changed files with 10 additions and 6 deletions

View File

@@ -24,16 +24,15 @@ function! s:prototype.add_raw(text)
endfunction
function! s:prototype.build()
if !self._active
if !self._context.active
let self._line = substitute(self._line, '%#.\{-}\ze#', '\0_inactive', 'g')
endif
return self._line
endfunction
function! airline#builder#new(active, highlighter)
function! airline#builder#new(context, highlighter)
let builder = copy(s:prototype)
let builder._sections = []
let builder._active = a:active
let builder._context = a:context
let builder._highlighter = a:highlighter
let builder._side = 1
let builder._curgroup = ''