I am writing a plugin that tries to use extra spaces in the status bar, displaying information of arbitrary length. Depending on the state of the current buffer, I want to display a specific fragment of this information.
I can capture the &statusline format &statusline , however this length can be very different from the actual screen length after all processing has been completed.
%< , and friends will not help me here, because I may need to trim from both ends of the line if the information I want to see is in the middle. I can determine which section of the string I want using the current status of the active buffer.
Is there any way to capture the processed status line through vimscript so that I can change it and make reasonable decisions based on its length?
source share