]> granicus.if.org Git - vim/commitdiff
patch 8.2.5108: retab test disabled because it hangs on MS-Windows v8.2.5108
authorBram Moolenaar <Bram@vim.org>
Thu, 16 Jun 2022 11:10:48 +0000 (12:10 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 16 Jun 2022 11:10:48 +0000 (12:10 +0100)
Problem:    Retab test disabled because it hangs on MS-Windows.
Solution:   Also set got_int at the other place a overlong text is detected.

src/indent.c
src/testdir/test_retab.vim
src/version.c

index 73eb12c49b0f62a06776ca483774af4e1b9b28fa..794fa2c3430bcba8a499364fb3c1af0108b02e44 100644 (file)
@@ -1612,6 +1612,20 @@ copy_indent(int size, char_u *src)
     return TRUE;
 }
 
+/*
+ * Give a "resulting text too long" error and maybe set got_int.
+ */
+    static void
+emsg_text_too_long(void)
+{
+    emsg(_(e_resulting_text_too_long));
+#ifdef FEAT_EVAL
+    // when not inside a try/catch set got_int to break out of any loop
+    if (trylevel == 0)
+#endif
+       got_int = TRUE;
+}
+
 /*
  * ":retab".
  */
@@ -1749,7 +1763,7 @@ ex_retab(exarg_T *eap)
                        new_len = old_len - col + start_col + len + 1;
                        if (new_len <= 0 || new_len >= MAXCOL)
                        {
-                           emsg(_(e_resulting_text_too_long));
+                           emsg_text_too_long();
                            break;
                        }
                        new_line = alloc(new_len);
@@ -1780,13 +1794,7 @@ ex_retab(exarg_T *eap)
            vcol += chartabsize(ptr + col, (colnr_T)vcol);
            if (vcol >= MAXCOL)
            {
-               emsg(_(e_resulting_text_too_long));
-               // when not inside a try/catch set got_int to break out of any
-               // loop
-#ifdef FEAT_EVAL
-               if (trylevel == 0)
-#endif
-                   got_int = TRUE;
+               emsg_text_too_long();
                break;
            }
            if (has_mbyte)
index 4253e77487fa67d5d7e98a33444e0e00c5ab3744..a4f95053c0b1edfa52e5425b66e75f0397174bb4 100644 (file)
@@ -92,7 +92,7 @@ func RetabLoop()
 endfunc
 
 func Test_retab_endless()
-  " inside try/catch we catch the error message
+  " inside try/catch we can catch the error message
   call setline(1, "\t0\t")
   let caught = 'no'
   try
@@ -106,13 +106,7 @@ func Test_retab_endless()
 endfunc
 
 func Test_nocatch_retab_endless()
-  " FIXME: why does this hang on MS-Windows?  Is got_int reset somewhere?
-  if has('win32')
-    let g:skipped_reason = "does not work on MS-Windows"
-    return
-  endif
-
-  " not inside try/catch an interrupt is generated to get out of loops
+  " when not inside try/catch an interrupt is generated to get out of loops
   call setline(1, "\t0\t")
   call assert_fails('call RetabLoop()', ['E1240:', 'Interrupted'])
 
index 81270a33638c4ed2e53032e72ff5c18f783eadb1..385c8ffbe066ebacc1f171fa24575f81a860f12c 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    5108,
 /**/
     5107,
 /**/