summaryrefslogtreecommitdiffstats
path: root/gvim/vim-7.2/7.2.342
blob: 72bf253e8c531eae4958321268d7340f21c3d267 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
To: vim-dev@vim.org
Subject: Patch 7.2.342
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.2.342
Problem:    Popup menu displayed wrong in 'rightleft' mode when there are
	    multi-byte characters.
Solution:   Adjust the column computations. (Dominique Pelle)
Files:	    src/popupmnu.c


*** ../vim-7.2.341/src/popupmnu.c	2008-11-15 14:10:23.000000000 +0100
--- src/popupmnu.c	2010-01-19 17:57:05.000000000 +0100
***************
*** 345,365 ****
  			    if (st != NULL)
  			    {
  				char_u	*rt = reverse_text(st);
- 				char_u	*rt_saved = rt;
- 				int	len, j;
  
  				if (rt != NULL)
  				{
! 				    len = (int)STRLEN(rt);
! 				    if (len > pum_width)
  				    {
! 					for (j = pum_width; j < len; ++j)
  					    mb_ptr_adv(rt);
! 					len = pum_width;
  				    }
! 				    screen_puts_len(rt, len, row,
! 							col - len + 1, attr);
! 				    vim_free(rt_saved);
  				}
  				vim_free(st);
  			    }
--- 345,380 ----
  			    if (st != NULL)
  			    {
  				char_u	*rt = reverse_text(st);
  
  				if (rt != NULL)
  				{
! 				    char_u	*rt_start = rt;
! 				    int		size;
! 
! 				    size = vim_strsize(rt);
! 				    if (size > pum_width)
  				    {
! 					do
! 					{
! 					    size -= has_mbyte
! 						    ? (*mb_ptr2cells)(rt) : 1;
  					    mb_ptr_adv(rt);
! 					} while (size > pum_width);
! 
! 					if (size < pum_width)
! 					{
! 					    /* Most left character requires
! 					     * 2-cells but only 1 cell is
! 					     * available on screen.  Put a
! 					     * '<' on the left of the pum
! 					     * item */
! 					    *(--rt) = '<';
! 					    size++;
! 					}
  				    }
! 				    screen_puts_len(rt, (int)STRLEN(rt),
! 						   row, col - size + 1, attr);
! 				    vim_free(rt_start);
  				}
  				vim_free(st);
  			    }
*** ../vim-7.2.341/src/version.c	2010-01-19 17:40:39.000000000 +0100
--- src/version.c	2010-01-19 18:03:22.000000000 +0100
***************
*** 683,684 ****
--- 683,686 ----
  {   /* Add new patch number below this line */
+ /**/
+     342,
  /**/

-- 
I have a watch cat! Just break in and she'll watch.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- 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    ///