[bug report] omni popup window was broken into two

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug report] omni popup window was broken into two

Sean-130
Conditions:

(1) omni popup window
(2) looooooooong line
(3) match at the end of line

Behavior: see picture:
http://vimim.googlecode.com/issues/attachment?aid=-5825397718578332051&name=VimIM-BUG.png&inline=1

What we expect:
The rightest side of omni window should be in line with the rightest
virtual column

Any workaround?

Thanks

Sean


--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: omni popup window was broken into two

suxpert
The title is actually not so good. :)

The fact is that the popup menu MAY sometimes uncomplete when the
right-side of the menu is out-of-boundary, or when we try to set
linebreak, the popup menu is divided into two parts. :)

On 1月11日, 上午11时46分, Sean <[hidden email]> wrote:

> Conditions:
>
> (1) omni popup window
> (2) looooooooong line
> (3) match at the end of line
>
> Behavior: see picture:http://vimim.googlecode.com/issues/attachment?aid=-582539771857833205...
>
> What we expect:
> The rightest side of omni window should be in line with the rightest
> virtual column
>
> Any workaround?
>
> Thanks
>
> Sean

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: [bug report] omni popup window was broken into two

Dominique Pellé
In reply to this post by Sean-130
Sean wrote:

> Conditions:
>
> (1) omni popup window
> (2) looooooooong line
> (3) match at the end of line
>
> Behavior: see picture:
> http://vimim.googlecode.com/issues/attachment?aid=-5825397718578332051&name=VimIM-BUG.png&inline=1
>
> What we expect:
> The rightest side of omni window should be in line with the rightest
> virtual column
>
> Any workaround?
>
> Thanks
Hi Sean

I can reproduce the bug you describe with Vim-7.2.327
on Linux (both in terminal or with Gvim GTK2).

Here is a reproducible case:

$ vim -u NONE -U NONE -g \
   -c 'set columns=79|call feedkeys("A\<c-n>")' bug-pum.txt

where bug-pum.txt is the attached file.

This is what I see when I run above command:

http://dominique.pelle.free.fr/pic/bug-pum.png

Cheers
-- Dominique

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

bug-pum.txt (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [bug report] omni popup window was broken into two

Bram Moolenaar
In reply to this post by Sean-130

Sean Ma wrote:

> Conditions:
>
> (1) omni popup window
> (2) looooooooong line
> (3) match at the end of line
>
> Behavior: see picture:
> http://vimim.googlecode.com/issues/attachment?aid=-5825397718578332051&name=VimIM-BUG.png&inline=1
>
> What we expect:
> The rightest side of omni window should be in line with the rightest
> virtual column
>
> Any workaround?
Does this only happen for a menu with double-wide characters?

--
A fool learns from his mistakes, a wise man from someone else's.

 /// Bram Moolenaar -- [hidden email] -- 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_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: omni popup window was broken into two

suxpert
> Does this only happen for a menu with double-wide characters?

I'm afraid not. :)

I've just do a quick test on the behaves of the popup menu, my
environment is:

Linux 2.6, VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Sep 21 2009
11:19:54)
with patch: 1-245 with GUI
(In fact I'm using Ubuntu 9.10, and just apt-get vim from the software
center :) )

Here is some screen-shots:
http://public.bay.livefilestore.com/y1prxgDvG7q6RNaj6xL5tGb4FmZfxX8qCM9Hkef1qlQuYR75g30L5ve6_8LIxWdQ9eq1wj-UhYd9rHl8OfLD3a9Zg/omni_popup_gvim_nolinebreak.png
http://public.bay.livefilestore.com/y1pf84wRZIexzHTpkAvSsod_b1QE1B7brmsLguSAfT0tvZn79AlQXp9CvH8DYxZy8nD_P2_tnx-v4_PUQO5u4v5BA/Omni_popup_menu_vim_nolinebreak.png

I've used --noplugin parameter to avoid any conflict. Both Ctrl-N and
Ctrl-X+Ctrl-N behaves like this.

BTW, the linebreak DOES NOT make any difference on the popup-menu,
exactly the seem as above. So the double-wide character is really some
factor. So what I've post should be modified into:

> The popup menu MAY sometimes incomplete when the
> right-side of the menu is out-of-boundary, or when we try to set
> linebreak, the popup menu is divided into two parts if it contains any double-wide characters.
(Sorry for the typo :) )

Thank you for your VIM. :)

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: [bug report] omni popup window was broken into two

Dominique Pellé
In reply to this post by Sean-130
Sean wrote:

> Conditions:
>
> (1) omni popup window
> (2) looooooooong line
> (3) match at the end of line
>
> Behavior: see picture:
> http://vimim.googlecode.com/issues/attachment?aid=-5825397718578332051&name=VimIM-BUG.png&inline=1
>
> What we expect:
> The rightest side of omni window should be in line with the rightest
> virtual column
>
> Any workaround?

Attached patch fixes the bug.  Please try it and also review
it since I'm not too familiar with all the magic in function
screen_puts_len(...).

What I see is that the condition to exit loop at line
screen.c:6380 assumes that character takes only 1 cell:

  screen.c:
  6380     while (col < screen_Columns

We only know how many cells takes the character to be
outputted a few lines below.

Patch prints a '>' instead of a 2-cell character if it remains
only 1 cell on the screen. Outputting the 2-cell char would
go beyond the screen, and not outputting anything would
leave a hole in the pum.

See screenshots before & after fix:

  http://dominique.pelle.free.fr/pic/pum-before-fix.png
  http://dominique.pelle.free.fr/pic/pum-after-fix.png

Note that this code is not specific to the pum, so it may fix
other bugs when displaying characters which span 2 cells.

Although patch fixes this bug, I observe other bugs which
are probably unrelated and which happen already before
the patch:

* when resizing the window while the pum is displayed I
  observe some glitches in the pum display sometimes.

* pum contains holes when 'rightleft' is set and items in pum
  contain characters which span 2 cells.

-- Dominique

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

fix-pum-7.2.329.patch (944 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [bug report] omni popup window was broken into two

Bram Moolenaar

Dominique Pelle wrote:

> Sean wrote:
>
> > Conditions:
> >
> > (1) omni popup window
> > (2) looooooooong line
> > (3) match at the end of line
> >
> > Behavior: see picture:
> > http://vimim.googlecode.com/issues/attachment?aid=-5825397718578332051&name=VimIM-BUG.png&inline=1
> >
> > What we expect:
> > The rightest side of omni window should be in line with the rightest
> > virtual column
> >
> > Any workaround?
>
>
> Attached patch fixes the bug.  Please try it and also review
> it since I'm not too familiar with all the magic in function
> screen_puts_len(...).
>
> What I see is that the condition to exit loop at line
> screen.c:6380 assumes that character takes only 1 cell:
>
>   screen.c:
>   6380     while (col < screen_Columns
>
> We only know how many cells takes the character to be
> outputted a few lines below.
>
> Patch prints a '>' instead of a 2-cell character if it remains
> only 1 cell on the screen. Outputting the 2-cell char would
> go beyond the screen, and not outputting anything would
> leave a hole in the pum.
>
> See screenshots before & after fix:
>
>   http://dominique.pelle.free.fr/pic/pum-before-fix.png
>   http://dominique.pelle.free.fr/pic/pum-after-fix.png
>
> Note that this code is not specific to the pum, so it may fix
> other bugs when displaying characters which span 2 cells.
>
> Although patch fixes this bug, I observe other bugs which
> are probably unrelated and which happen already before
> the patch:
>
> * when resizing the window while the pum is displayed I
>   observe some glitches in the pum display sometimes.
>
> * pum contains holes when 'rightleft' is set and items in pum
>   contain characters which span 2 cells.
Thanks for the patch!  I'll check the details later.

--
From "know your smileys":
 :-* A big kiss!

 /// Bram Moolenaar -- [hidden email] -- 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_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: [bug report] omni popup window was broken into two

Dominique Pellé
In reply to this post by Dominique Pellé
Dominique Pellé wrote:

> ...snip...
> Although patch fixes this bug, I observe other bugs which
> are probably unrelated and which happen already before
> the patch:
>
> * when resizing the window while the pum is displayed I
>  observe some glitches in the pum display sometimes.
>
> * pum contains holes when 'rightleft' is set and items in pum
>  contain characters which span 2 cells.
> ...snip...
Hi

As mentioned in my previous email, pum displays incorrectly
in when doing 'set rightleft' and when pum contains multi-bytes
characters.  This bug is is unrelated to bug fixed in my previous
patch.

Steps to reproduce (with utf-8 locale), just run:

$ vim -c 'set rightleft tags=' \
  -c 'call feedkeys("ifoobar fooébar \<c-n>")'

This is how the pum looks like before & after attached patch
using above command:

http://dominique.pelle.free.fr/pic/pum-multibyte-rightleft-before-patch.png
http://dominique.pelle.free.fr/pic/pum-multibyte-rightleft-after-patch.png

Patch should also handle truncated items when pum contains
characters which need 2-cells.  A '<' char may then be displayed
when left char requires 2 cells but only 1 cell is available
on screen as in this example (with screenshot below):

$ vim -u NONE -c 'set lines=25 columns=80 rightleft tags='  \
   -c  'call feedkeys("ifoo bar " . repeat("\u57fa", 20) . " \<c-n>")'

http://dominique.pelle.free.fr/pic/pum-multibyte-right-left-truncated-2-cells.png

PS: I tested this patch on top of patch in my previous email
which fixed another pum bug in screen_puts_len(...).

-- Dominique

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

fix-pum-rightleft-7.2.329.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: omni popup window was broken into two

suxpert
In reply to this post by Dominique Pellé
> Patch prints a '>' instead of a 2-cell character if it remains
> only 1 cell on the screen. Outputting the 2-cell char would
> go beyond the screen, and not outputting anything would
> leave a hole in the pum.

So the pop-up-menu is still incomplete, am I right?

I notice that this patch DOES fix something, which should be scripted
as "A double-wide character in the pop-up-menu was broken into two"
while I think the problem should be "the pop-up-menu was incomplete",
also it is not the same as the title. :)

As my experience, the wide of the pop-up menu when happens on the
right edge with only English letters can be only 15-letters as a max,
just like my screen-shot shows, ---that is just a guess, but I wonder
if there is some way to trying to display everything, because when we
use Keyword complete, there must be a chance to meet something like
myProjectID_Do_excise_A, myProjectID_Do_excise_B, I know it is not a
good habit to leave such a long name at the end of a line, but if that
happen, how can we know which term in the pop-up menu is the one I
need, when it only shows the first 15 letter? (Because I think it
should be faster if I know where is it :) )

It needs a solution.

BTW, why not use numbers or even letters to choose the term, instead
of Ctrl-N and Ctrl-Ns, or Ctrl-P and Ctrl-Ps?

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php