Lech Lorens wrote:
> Executing the following script (e.g. by saving it into a file called
> do.vim and executing "vim -u NONE -S do.vim") while in src directory
> containing Vim sources should give an incorrectly placed pop-up menu.
>
> #v+
> set nocompatible
> syntax on
> filetype plugin indent on
> e ex_docmd.c
> set lines=76
> set scrolloff=0
> set nosplitbelow
> 1647
> normal zt
> 1687
> call feedkeys("o\<CR>if (ea.\<C-x>\<C-o>\<C-e>\<C-x>\<C-o>", 'n')
> #v-
>
> If you scroll through the entries by pressing <C-n> or <C-p> you will
> notice that the part of the menu above the line containing the cursor is
> only an image of a previously drawn menu which should have in fact been
> cleared.
>
> The attached patch fixes the problem.
>
> The source of the problem:
>
> The function ins_compl_show_pum() is called twice:
> - once by ins_compl_next() which is called by ins_complete(),
> - once by ins_complete() itself.
>
> ins_compl_show_pum() calls pum_display() which uses the value of
> curwin->w_wrow to calculate the position of the pop-up menu.
> curwin->w_wrow is different in the two calls to ins_compl_show_pum().
>
> NOTE:
> - being able to reproduce the problem depends on the size of the screen
> (hence "set lines=76"),
> - it is not possible to make the check for w_wrow in
> ins_compl_upd_pum(), as it would not work for gvim (setcursor()
> is called in ins_compl_next()).
Hi
I don't see anything wrong when I execute those steps
with Vim in a terminal (gnome-terminal).
However, by default, there is no pum and I see...
-- Omni completion (^O^N^P) Pattern not found
To see the pum, I first need to build a "tags" file with
for example:
$ cd vim/src
$ ctags -R --c++-kinds=+p --fields=+iaSn --extra=+q .
$ vim -u NONE -S do.vim
The pum then shows up fine and pressing <C-n> or <C-p>
also updates the pum correctly here (using regular
Vim-7.2.385 without your patch).
Can you perhaps give a screenshot of what you saw?
Having said that, when I try to do it in gvim (GTK2) with...
$ vim -f -g -u NONE -S do.vim
.., then I do not see the pum anymore?! In fact, I do
not see the statusline either in gvim. It happens because
my screen is too small to display 76 lines. Commenting
out the line "set lines=76" in "do.vim" or setting a line number
small enough to be fully displayed on screen (such as
"set lines=40") makes it work in gvim too (no pum display
bug). I believe that not seeing the statusline when giving
a high value for "set lines=..." is another bug. Does
anybody else see that too?
Can you also reproduce the bug with a small value of lines?
(such as "set lines=40")?
Cheers
-- 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