Karsten Hopp 89d01c
To: vim-dev@vim.org
Karsten Hopp 89d01c
Subject: Patch 7.2.342
Karsten Hopp 89d01c
Fcc: outbox
Karsten Hopp 89d01c
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 89d01c
Mime-Version: 1.0
Karsten Hopp 89d01c
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 89d01c
Content-Transfer-Encoding: 8bit
Karsten Hopp 89d01c
------------
Karsten Hopp 89d01c
Karsten Hopp 89d01c
Patch 7.2.342
Karsten Hopp 89d01c
Problem:    Popup menu displayed wrong in 'rightleft' mode when there are
Karsten Hopp 89d01c
	    multi-byte characters.
Karsten Hopp 89d01c
Solution:   Adjust the column computations. (Dominique Pelle)
Karsten Hopp 89d01c
Files:	    src/popupmnu.c
Karsten Hopp 89d01c
Karsten Hopp 89d01c
Karsten Hopp 89d01c
*** ../vim-7.2.341/src/popupmnu.c	2008-11-15 14:10:23.000000000 +0100
Karsten Hopp 89d01c
--- src/popupmnu.c	2010-01-19 17:57:05.000000000 +0100
Karsten Hopp 89d01c
***************
Karsten Hopp 89d01c
*** 345,365 ****
Karsten Hopp 89d01c
  			    if (st != NULL)
Karsten Hopp 89d01c
  			    {
Karsten Hopp 89d01c
  				char_u	*rt = reverse_text(st);
Karsten Hopp 89d01c
- 				char_u	*rt_saved = rt;
Karsten Hopp 89d01c
- 				int	len, j;
Karsten Hopp 89d01c
  
Karsten Hopp 89d01c
  				if (rt != NULL)
Karsten Hopp 89d01c
  				{
Karsten Hopp 89d01c
! 				    len = (int)STRLEN(rt);
Karsten Hopp 89d01c
! 				    if (len > pum_width)
Karsten Hopp 89d01c
  				    {
Karsten Hopp 89d01c
! 					for (j = pum_width; j < len; ++j)
Karsten Hopp 89d01c
  					    mb_ptr_adv(rt);
Karsten Hopp 89d01c
! 					len = pum_width;
Karsten Hopp 89d01c
  				    }
Karsten Hopp 89d01c
! 				    screen_puts_len(rt, len, row,
Karsten Hopp 89d01c
! 							col - len + 1, attr);
Karsten Hopp 89d01c
! 				    vim_free(rt_saved);
Karsten Hopp 89d01c
  				}
Karsten Hopp 89d01c
  				vim_free(st);
Karsten Hopp 89d01c
  			    }
Karsten Hopp 89d01c
--- 345,380 ----
Karsten Hopp 89d01c
  			    if (st != NULL)
Karsten Hopp 89d01c
  			    {
Karsten Hopp 89d01c
  				char_u	*rt = reverse_text(st);
Karsten Hopp 89d01c
  
Karsten Hopp 89d01c
  				if (rt != NULL)
Karsten Hopp 89d01c
  				{
Karsten Hopp 89d01c
! 				    char_u	*rt_start = rt;
Karsten Hopp 89d01c
! 				    int		size;
Karsten Hopp 89d01c
! 
Karsten Hopp 89d01c
! 				    size = vim_strsize(rt);
Karsten Hopp 89d01c
! 				    if (size > pum_width)
Karsten Hopp 89d01c
  				    {
Karsten Hopp 89d01c
! 					do
Karsten Hopp 89d01c
! 					{
Karsten Hopp 89d01c
! 					    size -= has_mbyte
Karsten Hopp 89d01c
! 						    ? (*mb_ptr2cells)(rt) : 1;
Karsten Hopp 89d01c
  					    mb_ptr_adv(rt);
Karsten Hopp 89d01c
! 					} while (size > pum_width);
Karsten Hopp 89d01c
! 
Karsten Hopp 89d01c
! 					if (size < pum_width)
Karsten Hopp 89d01c
! 					{
Karsten Hopp 89d01c
! 					    /* Most left character requires
Karsten Hopp 89d01c
! 					     * 2-cells but only 1 cell is
Karsten Hopp 89d01c
! 					     * available on screen.  Put a
Karsten Hopp 89d01c
! 					     * '<' on the left of the pum
Karsten Hopp 89d01c
! 					     * item */
Karsten Hopp 89d01c
! 					    *(--rt) = '<';
Karsten Hopp 89d01c
! 					    size++;
Karsten Hopp 89d01c
! 					}
Karsten Hopp 89d01c
  				    }
Karsten Hopp 89d01c
! 				    screen_puts_len(rt, (int)STRLEN(rt),
Karsten Hopp 89d01c
! 						   row, col - size + 1, attr);
Karsten Hopp 89d01c
! 				    vim_free(rt_start);
Karsten Hopp 89d01c
  				}
Karsten Hopp 89d01c
  				vim_free(st);
Karsten Hopp 89d01c
  			    }
Karsten Hopp 89d01c
*** ../vim-7.2.341/src/version.c	2010-01-19 17:40:39.000000000 +0100
Karsten Hopp 89d01c
--- src/version.c	2010-01-19 18:03:22.000000000 +0100
Karsten Hopp 89d01c
***************
Karsten Hopp 89d01c
*** 683,684 ****
Karsten Hopp 89d01c
--- 683,686 ----
Karsten Hopp 89d01c
  {   /* Add new patch number below this line */
Karsten Hopp 89d01c
+ /**/
Karsten Hopp 89d01c
+     342,
Karsten Hopp 89d01c
  /**/
Karsten Hopp 89d01c
Karsten Hopp 89d01c
-- 
Karsten Hopp 89d01c
I have a watch cat! Just break in and she'll watch.
Karsten Hopp 89d01c
Karsten Hopp 89d01c
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 89d01c
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 89d01c
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 89d01c
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///