]> granicus.if.org Git - vim/commitdiff
updated for version 7.0g05
authorBram Moolenaar <Bram@vim.org>
Sat, 6 May 2006 21:38:18 +0000 (21:38 +0000)
committerBram Moolenaar <Bram@vim.org>
Sat, 6 May 2006 21:38:18 +0000 (21:38 +0000)
src/message.c
src/window.c

index a242a26b0c9e7f30adeb85344254b1e1b8102246..aebf01bb81134400fb072dafdbc81a16e246c4a5 100644 (file)
@@ -2595,8 +2595,11 @@ do_more_prompt(typed_char)
                    {
                        /* redisplay all lines */
                        screenclear();
-                       for (i = 0; i < Rows - 1; ++i)
+                       for (i = 0; mp != NULL && i < Rows - 1; ++i)
+                       {
                            mp = disp_sb_line(i, mp);
+                           ++msg_scrolled;
+                       }
                    }
                    scroll = 0;
                }
index cbcdd4eb91631c3f0e046a7169d0bda8cdbe63fc..c4cd31a71f7cedfd877e3090fabc007c287182d3 100644 (file)
@@ -3425,19 +3425,22 @@ enter_tabpage(tp, old_curbuf)
     buf_T      *old_curbuf;
 {
     int                old_off = tp->tp_firstwin->w_winrow;
+    win_T      *next_prevwin = tp->tp_prevwin;
 
     curtab = tp;
     firstwin = tp->tp_firstwin;
     lastwin = tp->tp_lastwin;
     topframe = tp->tp_topframe;
-#ifdef FEAT_AUTOCMD
-    apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf);
-#endif
 
+    /* We would like doing the TabEnter event first, but we don't have a
+     * valid current window yet, which may break some commands.
+     * This triggers autocommands, thus may make "tp" invalid. */
     win_enter_ext(tp->tp_curwin, FALSE, TRUE);
-    prevwin = tp->tp_prevwin;
+    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