Could somebody explain me what happens here? I want to get my plugin update the airline at the MpcAdd function call. Yet, no calls seem to work from inside the function. The MpcAdd function call is triggered.

(If I was to write the qwe line immediately after the asd line, qwe would show up)

function! s:RefreshAirline(text)
    call airline#parts#define('andrew', {'text': a:text})
    let g:airline_section_b = airline#section#create(['andrew'])

call s:RefreshAirline("asd")

function! s:MpcAdd(line)
    let l:file = split(a:line)[0]
    call s:RefreshAirline("qwe")  <--- does not work here
    silent execute ":redraw!"
  • Looks like it should work. Try adding something like echoerr 'RefreshAirline, text = '.text to s:RefreshAirline() to see whether it's actually called with qwe or not. – xaizek Mar 13 '18 at 20:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.