2

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'])
endfunction

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!"
endfunction
1
  • 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
    Commented Mar 13, 2018 at 20:06

0

Browse other questions tagged or ask your own question.