summaryrefslogtreecommitdiffstats
path: root/src/indent.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-06-16 12:10:48 +0100
committerBram Moolenaar <Bram@vim.org>2022-06-16 12:10:48 +0100
commit308660bd263367a4f1a75498cbd2e29cade47f4d (patch)
treea70aac5e21b2dbe2191aa27dffc87d3e51aad133 /src/indent.c
parent93a1096fe48e12095544924adb267e3b8a16b221 (diff)
patch 8.2.5108: retab test disabled because it hangs on MS-Windowsv8.2.5108
Problem: Retab test disabled because it hangs on MS-Windows. Solution: Also set got_int at the other place a overlong text is detected.
Diffstat (limited to 'src/indent.c')
-rw-r--r--src/indent.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/indent.c b/src/indent.c
index 73eb12c49b..794fa2c343 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1613,6 +1613,20 @@ copy_indent(int size, char_u *src)
}
/*
+ * 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".
*/
void
@@ -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)