itchyny/lightline.vim

Is it possible to get the original statusline text?

jZhangTk opened this issue · 2 comments

Some plugins write to statusline. For example, vial-http writes http response to statusline (using python).

    win.options['statusline'] = 'Response: {} {} {}ms {}ms {}'.format(
        rctx.response.status, rctx.response.reason,
        rctx.ctime, rctx.rtime, sizeof_fmt(size))

When lightline is disabled, I'm able to see the text and get it in &statusline. However, if lightline is enabled, &statusline is replaced by lightline and I can't get the text anywhere.

Is it possible to create a component (or something) to hold the original statusline text when something to the statusline so that it can be displayed in lightline?

The extensibility of lightline can be achieved by the exported APIs of other plugins. It is impossible to use the original statusline text. Recommendation is to create a function component using the function (or variables) of that plugin, or if there isn't, propose the plugin author to add APIs for obtaining the information.

That makes total sense. Funny enough, I actually created a variable in my local to work around it 😄 I'll suggest it and create a PR in vial-http.