Hi Bram!
On Fr, 14 Jun 2013, Bram Moolenaar wrote:
>
> Christian Brabandt wrote:
>
> > Bram,
> > when vim starts up, and some plugin opens the preview window, the cursor
> > will move to the preview window and not stay in the other window.
> >
> > This can be seen here:
> >
> > vim -u NONE -N --cmd 'pedit ~/.vimrc' foobar
> >
> > Note, that the cursor is in the window with your $VIMRC and not in the
> > other one. I found this unexpected, so here is a patch, that fixes it.
>
> This solution doesn't look right. Instead of not going to the first
> window, it should probably do that and then, if it is a preview window,
> find another window to go to. I'm not sure what happens if you leave
> "curwin" on whatever it was.
Is this better?
diff --git a/src/main.c b/src/main.c
--- a/src/main.c
+++ b/src/main.c
@@ -2817,6 +2817,21 @@
--autocmd_no_enter;
# endif
win_enter(firstwin, FALSE); /* back to first window */
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ if (firstwin->w_p_pvw)
+ {
+ win_T *win;
+
+ for (win = firstwin; win != NULL; win = win->w_next)
+ {
+ if (!win->w_p_pvw)
+ {
+ win_enter(win, FALSE); /* got to a non-preview window */
+ break;
+ }
+ }
+ }
+#endif
# ifdef FEAT_AUTOCMD
--autocmd_no_leave;
# endif
regards,
Christian
--
Das beste Mittel, jeden Tag gut zu beginnen, ist: beim Erwachen daran
zu denken, ob man nicht wenigstens einem Menschen an diesem Tage eine
Freude machen könnte.
-- Friedrich Wilhelm Nietzsche
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.