Lech Lorens wrote:

> On 14-Mar-2010 Dominique Pellé <[email protected]> wrote:
>> $ 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.

Just to confirm that I can reproduce the negative line number bug
you describe (with gvim GTK2) and that setting "curwin->w_cursor.lnum"
to 1 instead of 0 at popupmnu.c:643 does indeed fix it and also fixes
the E38 error described by Dan. It looks promising.

-- Dominique

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

Raspunde prin e-mail lui