Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(statusline): set 'statusline' once (and not update on events)
Details: - Setting targeted window-local values of 'statusline' on appropriate events is (on paper) better for performance. However, this introduces issues when those targeted events don't trigger (like `noautocmd` with floating windows). Although blocking important events is more or less a fault of what's blocking them, working around various issues doesn't really worth a performance boost. Instead set 'statusline' option once globally to a Vimscript value which will dynamically decide which content (active or inactive) to show. The computation overhead is pretty minimal (around 0.13 microseconds for every 'statusline' evaluation) but the increase in robustness seems to be worth it (as now type of content will be decided just at the time when it is needed). This is made possible by a deeply hidden `g:actual_curwin` variable which is set during `%{%...%}` statusline evaluation specifically for this reason (to be able for the statusline to be both evaluated inside its target window and decide if that target is actually current).
- Loading branch information