From 5ad15df9ce49f0b7adeac2c8387319d6f309bd5f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 16 Mar 2012 19:07:58 +0100 Subject: [PATCH] =?utf8?q?updated=20for=20version=207.3.472=20Problem:=20?= =?utf8?q?=20=20=20Crash=20when=20using=20":redraw"=20in=20a=20BufEnter=20?= =?utf8?q?autocommand=20and=20=20=20=20=20=20=20=20=20=20=20=20=20switchin?= =?utf8?q?g=20to=20another=20tab.=20(=E9=A9=BC=E5=B3=B0)=20Solution:=20=20?= =?utf8?q?=20Move=20triggering=20the=20the=20autocommands=20to=20after=20c?= =?utf8?q?orrecting=20the=20=20=20=20=20=20=20=20=20=20=20=20=20option=20v?= =?utf8?q?alues.=20Also=20check=20the=20row=20value=20to=20be=20out=20of?= =?utf8?q?=20bounds.=20=20=20=20=20=20=20=20=20=20=20=20=20(Christian=20Br?= =?utf8?q?abandt,=20Sergey=20Khorev)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/screen.c | 6 ++++++ src/version.c | 2 ++ src/window.c | 15 ++++++++------- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/screen.c b/src/screen.c index 9bac8bce3..97d636d70 100644 --- a/src/screen.c +++ b/src/screen.c @@ -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 diff --git a/src/version.c b/src/version.c index 41d967aff..f52d9fa4a 100644 --- a/src/version.c +++ b/src/version.c @@ -714,6 +714,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 472, /**/ 471, /**/ diff --git a/src/window.c b/src/window.c index 6c02570ff..0a0a2d495 100644 --- 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); } -- 2.50.1