From: Hirohito Higashi Date: Wed, 4 Mar 2026 19:09:37 +0000 (+0000) Subject: patch 9.2.0107: tests: Test_statuslineopt() is flaky X-Git-Tag: v9.2.0107^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76abd0ccdf4b57deca6ffbe3514c39f1bc227b13;p=thirdparty%2Fvim.git patch 9.2.0107: tests: Test_statuslineopt() is flaky Problem: tests: Test_statuslineopt() is flaky Solution: Force a redraw earlier and read screen content directly using screenstring() instead of g:ScreenLines() (Hirohito Higashi). closes: #19571 Signed-off-by: Hirohito Higashi Signed-off-by: Christian Brabandt --- diff --git a/src/testdir/test_statuslineopt.vim b/src/testdir/test_statuslineopt.vim index 7fcf489bf1..791a65ae57 100644 --- a/src/testdir/test_statuslineopt.vim +++ b/src/testdir/test_statuslineopt.vim @@ -17,15 +17,18 @@ def TearDown() enddef def s:Assert_match_statusline(winid: number, stlh: number, expect: list): void + redraw! if has('gui_running') - redraw! sleep 1m endif var wi = getwininfo(winid)[0] var winh = wi.winrow + wi.height - var lines = [winh, winh + wi.status_height - 1] - var actual = mapnew(g:ScreenLines(lines, &columns), (_, v) => - v[wi.wincol - 1 : wi.wincol - 1 + wi.width - 1]) + # Read screen content directly after redraw! to avoid a second redraw! + # inside g:ScreenLines() that may process GUI events and change the window + # layout between the getwininfo() call and the screenstring() calls. + var actual = mapnew(range(winh, winh + wi.status_height - 1), + (_, l) => join(mapnew(range(1, &columns), + (_, c) => screenstring(l, c)), '')[wi.wincol - 1 : wi.wincol - 1 + wi.width - 1]) assert_equal(stlh, wi.status_height) for i in range(len(expect)) assert_match(expect[i], actual[i], $'[{i}]') diff --git a/src/version.c b/src/version.c index e0bf8c7c78..63308de4b3 100644 --- a/src/version.c +++ b/src/version.c @@ -734,6 +734,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 107, /**/ 106, /**/