CI(screendump): Move an early-return test out of the loop

Commit: 
https://github.com/vim/vim/commit/64329714c7ea2b0520c5891f13dc00d1f8e2a41e
Author: Aliaksei Budavei <0x000...@gmail.com>
Date:   Fri Jul 25 20:05:37 2025 +0200

    CI(screendump): Move an early-return test out of the loop
    
    And express the established indentation style of the file in
    its modeline.
    
    related: #17704
    
    Signed-off-by: Aliaksei Budavei <0x000...@gmail.com>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/testdir/util/screendump.vim b/src/testdir/util/screendump.vim
index be6af861a..e39b334d2 100644
--- a/src/testdir/util/screendump.vim
+++ b/src/testdir/util/screendump.vim
@@ -46,8 +46,8 @@ enddef
 " Returns non-zero when verification fails.
 func VerifyScreenDump(buf, filename, options, ...)
   if has('gui_running') && exists("g:check_screendump_called") && 
g:check_screendump_called == v:false
-      echoerr "VerifyScreenDump() called from a test that lacks a 
CheckScreendump guard."
-      return 1
+    echoerr "VerifyScreenDump() called from a test that lacks a 
CheckScreendump guard."
+    return 1
   endif
   let reference = 'dumps/' . a:filename . '.dump'
   let filter = 'dumps/' . a:filename . '.vim'
@@ -66,34 +66,30 @@ func VerifyScreenDump(buf, filename, options, ...)
   " text and attributes only from the internal buffer.
   redraw
 
-  if filereadable(reference)
-    let refdump = ReadAndFilter(reference, filter)
-  else
-    " Must be a new screendump, always fail
-    let refdump = []
-  endif
-
   let did_mkdir = 0
   if !isdirectory('failed')
     let did_mkdir = 1
     call mkdir('failed')
   endif
 
+  if !filereadable(reference)
+    " Leave a bit of time for updating the original window while we spin wait.
+    sleep 10m
+    call delete(testfile)
+    call term_dumpwrite(a:buf, testfile, a:options)
+    call assert_report('See new dump file: call term_dumpload("testdir/' .. 
testfile .. '")')
+    " No point in retrying.
+    let g:run_nr = 10
+    return 1
+  endif
+
+  let refdump = ReadAndFilter(reference, filter)
   let i = 0
   while 1
-    " leave a bit of time for updating the original window while we spin wait.
+    " Leave a bit of time for updating the original window while we spin wait.
     sleep 1m
     call delete(testfile)
     call term_dumpwrite(a:buf, testfile, a:options)
-
-    if refdump->empty()
-      let msg = 'See new dump file: call term_dumpload("testdir/' .. testfile 
.. '")'
-      call assert_report(msg)
-      " no point in retrying
-      let g:run_nr = 10
-      return 1
-    endif
-
     let testdump = ReadAndFilter(testfile, filter)
     if refdump == testdump
       call delete(testfile)
@@ -137,3 +133,5 @@ func VerifyScreenDump(buf, filename, options, ...)
   endwhile
   return 0
 endfunc
+
+" vim:sw=2:ts=8:noet:

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1ufMws-00A4mW-7W%40256bit.org.

Raspunde prin e-mail lui