Robert Webb wrote:
> > > This appears to be a bug. Consider this test function.
> > >
> > > func! Test()
> > > let oldCursor = winsaveview()
> > > normal G
> > > call winrestview(oldCursor)
> > > split
> > > endfunc
> > >
> > > Now edit a long file and go somewhere where the end of the file is not
> > > too close, and call the function:
> > >
> > > :call Test()
> > >
> > > It splits a new window. Now close this window again, and in theory we
> > > should be exactly back to where we started, however instead the cursor
> > > line has shifted to the bottom line of the window (the cursor is still
> > > on the same line, but the window has scrolled).
> > >
> > > Why? The first three lines of the function should be a no-operation.
> > > Comment out the split and you'll see that it does as expected.
> > > Comment out the other three lines and again it behaves as expected.
> > > But with all lines something is wrong.
> > >
> > > I also tried saving restoring the window by remembering the top line
> > > and restoring it later, but it has the same problem. It is as if the
> > > split command is occurring in part before the window is restored.
> > >
> > > Anyone know how to work-around this for now?
> >
> > It works just fine for me. Perhaps you have something else that
> > interferes?
>
> I managed to track it down. You have to do ":set nowrap" too.
> Now even if no lines in the file are long enough for 'wrap' to make
> a difference, the bug will occur.
>
> I suggest starting with a long file and doing "50%" to go in half-way.
> Then ":call Test()" and the cursor line from the original window is now
> at the bottom instead of half-way down that window.
Very strange that this only happens with 'nowrap'. Defenitely looks
like a bug. One more for the todo list.
--
It doesn't really matter what you are able to do if you don't do it.
(Bram Moolenaar)
/// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---