Lech Lorens wrote:
> On 14-Mar-2010 Dominique Pellé <[email protected]> wrote:
> >
> > So the position of the cursor is wrong. I think
> > curwin->w_cursor.lnum is 0 because it's set
> > in popupmnu.c:643 to 0:
> >
> > 643 curwin->w_cursor.lnum = 0;
> >
> > If I replace this line with...
> >
> > 643 curwin->w_cursor.lnum = 1;
> >
> > ... then E38 no longer happens, but I have no idea
> > whether this fix is correct!
> >
> > $ hg diff popupmnu.c
> > diff -r aab202d244b6 src/popupmnu.c
> > --- a/src/popupmnu.c Wed Mar 10 17:16:12 2010 +0100
> > +++ b/src/popupmnu.c Sun Mar 14 10:50:53 2010 +0100
> > @@ -640,7 +640,7 @@
> >
> > curbuf->b_changed = 0;
> > curbuf->b_p_ma = FALSE;
> > - curwin->w_cursor.lnum = 0;
> > + curwin->w_cursor.lnum = 1;
> > curwin->w_cursor.col = 0;
> >
> > if (curwin != curwin_save && win_valid(curwin_save))
>
> Your modification fixes more than just this problem. Accidentally, I was
> recently investigating a problem with scrolling the preview window when
> the pop-up menu is visible. This can be reproduced as follows:
> - build C tags for Vim sources,
> - open ex_docmd.c in Gvim, go to line 1689,
> - set 'cot' to "menu,preview", set 'number',
> - insert the following line:
> if (ea.
> - without leaving the insert mode invoke omnicompletion by pressing <C-o>,
> - move the mouse pointer so that it hovers over the preview window and
> use the mouse scroll wheel to first scroll the window's contents up
> (by rotating the scroll wheel DOWN).
>
> At this point the preview window will have scrolled by 1 line in the
> opposite direction than intended and will show line number 0, containing
> a copy of line 1. What is more, if you scroll the mouse wheel up, you
> will be able to make the window display lines with negative numbers.
>
> Your patch prevents Gvim from behaving this way. My modifications fix
> the problem too but they do not fix the problem reported by Dasn.
> However, I am still attaching a patch for Bram to consider whether it is
> worthwhile to include the changes just for the sake of safety.
>
> The patch also includes a change to fold.c - I removed a redundant
> check.
I'll include that. And thanks for checking Dominique's patch.
--
CRONE: Who sent you?
ARTHUR: The Knights Who Say Ni!
CRONE: Aaaagh! (she looks around in rear) No! We have no shrubberies here.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// 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.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php