fix(statusline): broken statusline on error #38000

Problem: after #33036, an error from evaluating 'statusline' clears it and
doesn't draw the statusline. (causing glitchy redraws)

Solution: use the default value instead. If 'stl' is somehow ever empty, still
call redraw_custom_statusline to at least draw an empty statusline.

Ideally our default 'stl' shouldn't itself error too! :-)
Also adjust some prior screen:expect()s to avoid immediate success warnings.
This commit is contained in:
Sean Dewar
2026-02-23 16:22:13 +00:00
committed by GitHub
parent 2478a7fbbd
commit 32d3dd0650
6 changed files with 62 additions and 21 deletions

View File

@@ -8794,10 +8794,10 @@ local options = {
current window and buffer, while %{} items are evaluated in the
context of the window that the statusline belongs to.
When there is error while evaluating the option then it will be made
empty to avoid further errors. Otherwise screen updating would loop.
When the result contains unprintable characters the result is
unpredictable.
When there is an error while evaluating the option it will be reset to
its default value to avoid further errors. Otherwise screen updating
would loop. When the result contains unprintable characters the
result is unpredictable.
Note that the only effect of 'ruler' when this option is set (and
'laststatus' is 2 or 3) is controlling the output of |CTRL-G|.