Mercurial > vim
diff src/window.c @ 3413:8332129d9ae8 v7.3.472
updated for version 7.3.472
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)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Fri, 16 Mar 2012 19:07:58 +0100 |
parents | 9ccdc4a69d8f |
children | fa17c8646feb |
line wrap: on
line diff
--- a/src/window.c +++ b/src/window.c @@ -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); }