patch 9.2.0107: tests: Test_statuslineopt() is flaky

Commit: 
https://github.com/vim/vim/commit/76abd0ccdf4b57deca6ffbe3514c39f1bc227b13
Author: Hirohito Higashi <[email protected]>
Date:   Wed Mar 4 19:09:37 2026 +0000

    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 <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/testdir/test_statuslineopt.vim 
b/src/testdir/test_statuslineopt.vim
index 7fcf489bf..791a65ae5 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<string>): 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 e0bf8c7c7..63308de4b 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,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1vxrv2-006pqq-Rw%40256bit.org.

Raspunde prin e-mail lui