updated for version 7.2-122 v7.2.122
authorBram Moolenaar <Bram@vim.org>
Sun, 22 Feb 2009 20:13:39 +0000 (20:13 +0000)
committerBram Moolenaar <Bram@vim.org>
Sun, 22 Feb 2009 20:13:39 +0000 (20:13 +0000)
src/screen.c
src/version.c

index 6c036d7ed474fe88e6bc6bb8c54e19eeaf55f018..6d408eb925acbb487bb6eb4e71a20ba6065f5272 100644 (file)
@@ -7368,7 +7368,11 @@ screenalloc(clear)
 #endif
     static int     entered = FALSE;            /* avoid recursiveness */
     static int     done_outofmem_msg = FALSE;  /* did outofmem message */
+#ifdef FEAT_AUTOCMD
+    int                    retry_count = 0;
 
+retry:
+#endif
     /*
      * Allocation of the screen buffers is done only when the size changes and
      * when Rows and Columns have been set and we have started doing full
@@ -7643,8 +7647,17 @@ give_up:
     --RedrawingDisabled;
 
 #ifdef FEAT_AUTOCMD
-    if (starting == 0)
+    /*
+     * Do not apply autocommands more than 3 times to avoid an endless loop
+     * in case applying autocommands always changes Rows or Columns.
+     */
+    if (starting == 0 && ++retry_count <= 3)
+    {
        apply_autocmds(EVENT_VIMRESIZED, NULL, NULL, FALSE, curbuf);
+       /* In rare cases, autocommands may have altered Rows or Columns,
+        * jump back to check if we need to allocate the screen again. */
+       goto retry;
+    }
 #endif
 }
 
index b7d484c97b7eb5e32e1e2d3ff7c430b8e60f403a..d324ae37848ef6cc99504a4a9560f7ced568a89d 100644 (file)
@@ -676,6 +676,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    122,
 /**/
     121,
 /**/