maralla / validator.vim

Check syntax on the fly asynchronously.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Best way of integrating with airline?

vsviridov opened this issue · comments

What is the easiest way to display error/warning count in an airline segment?

I've resorted to doing something like this

if (exists('g:loaded_airline') && g:loaded_airline && exists('g:loaded_validator_plugin') && g:loaded_validator_plugin)
    call airline#parts#define_function('validator', 'validator#get_status_string')
    let g:airline_section_error = airline#section#create(['validator'])
endif

It would be very helpful if you'd expose specific counts of errors/warnings per buffer and also provide a way to register a callback after validation was completed. Currently Airline doesn't refresh since it's not aware of async operation.