]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.472 v7.3.472
authorBram Moolenaar <Bram@vim.org>
Fri, 16 Mar 2012 18:07:58 +0000 (19:07 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 16 Mar 2012 18:07:58 +0000 (19:07 +0100)
Problem:    Crash when using ":redraw" in a BufEnter autocommand and
            switching to another tab. (驼峰)
Solution:   Move triggering the the autocommands to after correcting the
            option values. Also check the row value to be out of bounds.
            (Christian Brabandt, Sergey Khorev)

src/screen.c
src/version.c
src/window.c

index 9bac8bce30a379656773361aa47a135e8c7478a3..97d636d700dc02c435306182ced3aacee290762e 100644 (file)
@@ -5371,6 +5371,12 @@ screen_line(row, coloff, endcol, clear_width
 # define CHAR_CELLS 1
 #endif
 
+    /* Check for illegal row and col, just in case. */
+    if (row >= Rows)
+       row = Rows - 1;
+    if (endcol > Columns)
+       endcol = Columns;
+
 # ifdef FEAT_CLIPBOARD
     clip_may_clear_selection(row, row);
 # endif
index 41d967aff32cfb11cd8319a69877b2c280d3b92c..f52d9fa4aa58bb34de4bc6b188fed4ca9ee1a54e 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    472,
 /**/
     471,
 /**/
index 6c02570ff3e8adf71bbc89e7707cc793241eace2..0a0a2d4957ea5e912e58b0696f012061807c1263 100644 (file)
@@ -3676,13 +3676,6 @@ enter_tabpage(tp, old_curbuf)
     win_enter_ext(tp->tp_curwin, FALSE, TRUE);
     prevwin = next_prevwin;
 
-#ifdef FEAT_AUTOCMD
-    apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf);
-
-    if (old_curbuf != curbuf)
-       apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf);
-#endif
-
     last_status(FALSE);                /* status line may appear or disappear */
     (void)win_comp_pos();      /* recompute w_winrow for all windows */
     must_redraw = CLEAR;       /* need to redraw everything */
@@ -3712,6 +3705,14 @@ enter_tabpage(tp, old_curbuf)
     gui_may_update_scrollbars();
 #endif
 
+#ifdef FEAT_AUTOCMD
+    /* Apply autocommands after updating the display, when 'rows' and
+     * 'columns' have been set correctly. */
+    apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf);
+    if (old_curbuf != curbuf)
+       apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf);
+#endif
+
     redraw_all_later(CLEAR);
 }