]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.007 v7.4.007
authorBram Moolenaar <Bram@vim.org>
Thu, 22 Aug 2013 12:14:27 +0000 (14:14 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 22 Aug 2013 12:14:27 +0000 (14:14 +0200)
Problem:    Creating a preview window on startup leaves the screen layout in a
            messed up state. (Marius Gedminas)
Solution:   Don't change firstwin. (Christian Brabandt)

src/main.c
src/version.c

index 884a3082ba621d161632facbd5fe69f67f014c75..7d01a232b364bb6278fbeb6f91d29658da8d4f65 100644 (file)
@@ -2727,6 +2727,7 @@ edit_buffers(parmp)
     int                arg_idx;                /* index in argument list */
     int                i;
     int                advance = TRUE;
+    win_T      *win;
 
 # ifdef FEAT_AUTOCMD
     /*
@@ -2816,24 +2817,22 @@ edit_buffers(parmp)
 # ifdef FEAT_AUTOCMD
     --autocmd_no_enter;
 # endif
+
+    /* make the first window the current window */
+    win = firstwin;
 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
-    /*
-     * Avoid making a preview window the current window.
-     */
-    if (firstwin->w_p_pvw)
+    /* Avoid making a preview window the current window. */
+    while (win->w_p_pvw)
     {
-       win_T   *win;
-
-       for (win = firstwin; win != NULL; win = win->w_next)
-           if (!win->w_p_pvw)
-           {
-               firstwin = win;
-               break;
-           }
+       win = win->w_next;
+       if (win == NULL)
+       {
+           win = firstwin;
+           break;
+       }
     }
 #endif
-    /* make the first window the current window */
-    win_enter(firstwin, FALSE);
+    win_enter(win, FALSE);
 
 # ifdef FEAT_AUTOCMD
     --autocmd_no_leave;
index 77c3e8d571cd2d2d928b5688f2f14030813fad9d..d34ed63ddf2c68d2ef11cd47eacc7e41fca1140a 100644 (file)
@@ -727,6 +727,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    7,
 /**/
     6,
 /**/