summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2009-02-22 20:13:39 +0000
committerBram Moolenaar <Bram@vim.org>2009-02-22 20:13:39 +0000
commit87e817c58618c461c2bb7aa6ca927bb8f4a82ee2 (patch)
tree2a0bb07eb314b9a565c89ad6f397bafe0948f1ed
parentb3dc8fd3fd8ae8ac742f993292c0d7e45a9b3977 (diff)
downloadvim-git-87e817c58618c461c2bb7aa6ca927bb8f4a82ee2.tar.gz
updated for version 7.2-122v7.2.122
-rw-r--r--src/screen.c15
-rw-r--r--src/version.c2
2 files changed, 16 insertions, 1 deletions
diff --git a/src/screen.c b/src/screen.c
index 6c036d7ed..6d408eb92 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -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
}
diff --git a/src/version.c b/src/version.c
index b7d484c97..d324ae378 100644
--- a/src/version.c
+++ b/src/version.c
@@ -677,6 +677,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 122,
+/**/
121,
/**/
120,