changeset 4912:d8f65e6238fa v7.3.1201

updated for version 7.3.1201 Problem: When a startup script creates a preview window, it probably becomes the current window. Solution: Make another window the current one. (Christian Brabandt)
author Bram Moolenaar <bram@vim.org>
date Sat, 15 Jun 2013 21:54:16 +0200
parents 78c318784090
children bec828d2e0f5
files src/main.c src/version.c
diffstat 2 files changed, 21 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/main.c
+++ b/src/main.c
@@ -2816,7 +2816,25 @@ edit_buffers(parmp)
 # ifdef FEAT_AUTOCMD
     --autocmd_no_enter;
 # endif
-    win_enter(firstwin, FALSE);		/* back to first window */
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+    /*
+     * Avoid making a preview window the current window.
+     */
+    if (firstwin->w_p_pvw)
+    {
+       win_T   *win;
+
+       for (win = firstwin; win != NULL; win = win->w_next)
+           if (!win->w_p_pvw)
+           {
+               firstwin = win;
+               break;
+           }
+    }
+#endif
+    /* make the first window the current window */
+    win_enter(firstwin, FALSE);
+
 # ifdef FEAT_AUTOCMD
     --autocmd_no_leave;
 # endif
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1201,
+/**/
     1200,
 /**/
     1199,