mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
updated for version 7.2.342
Problem: Popup menu displayed wrong in 'rightleft' mode when there are multi-byte characters. Solution: Adjust the column computations. (Dominique Pelle)
This commit is contained in:
parent
e4ebd29ea9
commit
d836bb90ab
@ -345,21 +345,36 @@ pum_redraw()
|
|||||||
if (st != NULL)
|
if (st != NULL)
|
||||||
{
|
{
|
||||||
char_u *rt = reverse_text(st);
|
char_u *rt = reverse_text(st);
|
||||||
char_u *rt_saved = rt;
|
|
||||||
int len, j;
|
|
||||||
|
|
||||||
if (rt != NULL)
|
if (rt != NULL)
|
||||||
{
|
{
|
||||||
len = (int)STRLEN(rt);
|
char_u *rt_start = rt;
|
||||||
if (len > pum_width)
|
int size;
|
||||||
|
|
||||||
|
size = vim_strsize(rt);
|
||||||
|
if (size > pum_width)
|
||||||
{
|
{
|
||||||
for (j = pum_width; j < len; ++j)
|
do
|
||||||
|
{
|
||||||
|
size -= has_mbyte
|
||||||
|
? (*mb_ptr2cells)(rt) : 1;
|
||||||
mb_ptr_adv(rt);
|
mb_ptr_adv(rt);
|
||||||
len = pum_width;
|
} 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, len, row,
|
screen_puts_len(rt, (int)STRLEN(rt),
|
||||||
col - len + 1, attr);
|
row, col - size + 1, attr);
|
||||||
vim_free(rt_saved);
|
vim_free(rt_start);
|
||||||
}
|
}
|
||||||
vim_free(st);
|
vim_free(st);
|
||||||
}
|
}
|
||||||
|
@ -681,6 +681,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
342,
|
||||||
/**/
|
/**/
|
||||||
341,
|
341,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user