David Lam wrote:
> hmm well, one handy thing I use a lot with vim is viewing/editing different
> parts of the same file via a :vsplit or <C-w>v
>
> and awhile ago, I remember after updating and building from the latest
> patched vim,that something felt funny when vertical splitting, because the
> cursor/window would scroll to the top instead of staying in the same place.
>
> To reproduce:
> 1. open a file which you would have to scroll to see the whole file in
> 7.3
> 2. push L
> 3.<C-w>v or :vsplit
> 4. The window/cursor on the left scrolls to the top (when it should
> really stay in the place?)
>
>
> I did a little testing and I think in versions prior, the cursor stays in
> the same place. Reverting one line from 7.2.398 seemingly fixes it -->
>
> diff -r a03f7551bacc src/window.c
> --- a/src/window.c Wed Dec 08 19:56:58 2010 +0100
> +++ b/src/window.c Thu Dec 09 01:06:58 2010 -0800
> @@ -1003,7 +1003,7 @@
> {
> /* height and row of new window is same as current window */
> wp->w_winrow = oldwin->w_winrow;
> - win_new_height(wp, oldwin->w_height);
> + wp->w_height = oldwin->w_height;
> wp->w_status_height = oldwin->w_status_height;
> }
> frp->fr_height = curfrp->fr_height;
I wonder if something goes wrong in other circumstances.
win_new_height() is supposed to keep the relative cursor position.
Perhaps there is something missing to copy the relative position to the
new window?
--
hundred-and-one symptoms of being an internet addict:
10. And even your night dreams are in HTML.
/// 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