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

Something like that.  But with only one win_enter().
I'll send out a patch, please try it out.

-- 
hundred-and-one symptoms of being an internet addict:
218. Your spouse hands you a gift wrapped magnet with your PC's name
     on it and you accuse him or her of genocide.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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.


Raspunde prin e-mail lui