forked from aniani/vim
updated for version 7.4.324
Problem: In Ex mode, cyrillic characters are not handled. (Stas Malavin) Solution: Support multi-byte characters in Ex mode. (Yukihiro Nakadaira)
This commit is contained in:
@@ -2188,6 +2188,7 @@ getexmodeline(promptc, cookie, indent)
|
|||||||
int vcol = 0;
|
int vcol = 0;
|
||||||
char_u *p;
|
char_u *p;
|
||||||
int prev_char;
|
int prev_char;
|
||||||
|
int len;
|
||||||
|
|
||||||
/* Switch cursor on now. This avoids that it happens after the "\n", which
|
/* Switch cursor on now. This avoids that it happens after the "\n", which
|
||||||
* confuses the system function that computes tabstops. */
|
* confuses the system function that computes tabstops. */
|
||||||
@@ -2264,7 +2265,17 @@ getexmodeline(promptc, cookie, indent)
|
|||||||
{
|
{
|
||||||
if (line_ga.ga_len > 0)
|
if (line_ga.ga_len > 0)
|
||||||
{
|
{
|
||||||
--line_ga.ga_len;
|
#ifdef FEAT_MBYTE
|
||||||
|
if (has_mbyte)
|
||||||
|
{
|
||||||
|
p = (char_u *)line_ga.ga_data;
|
||||||
|
p[line_ga.ga_len] = NUL;
|
||||||
|
len = (*mb_head_off)(p, p + line_ga.ga_len - 1) + 1;
|
||||||
|
line_ga.ga_len -= len;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
--line_ga.ga_len;
|
||||||
goto redraw;
|
goto redraw;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
@@ -2280,7 +2291,7 @@ getexmodeline(promptc, cookie, indent)
|
|||||||
|
|
||||||
if (c1 == Ctrl_T)
|
if (c1 == Ctrl_T)
|
||||||
{
|
{
|
||||||
long sw = get_sw_value(curbuf);
|
long sw = get_sw_value(curbuf);
|
||||||
|
|
||||||
p = (char_u *)line_ga.ga_data;
|
p = (char_u *)line_ga.ga_data;
|
||||||
p[line_ga.ga_len] = NUL;
|
p[line_ga.ga_len] = NUL;
|
||||||
@@ -2300,8 +2311,9 @@ redraw:
|
|||||||
/* redraw the line */
|
/* redraw the line */
|
||||||
msg_col = startcol;
|
msg_col = startcol;
|
||||||
vcol = 0;
|
vcol = 0;
|
||||||
for (p = (char_u *)line_ga.ga_data;
|
p = (char_u *)line_ga.ga_data;
|
||||||
p < (char_u *)line_ga.ga_data + line_ga.ga_len; ++p)
|
p[line_ga.ga_len] = NUL;
|
||||||
|
while (p < (char_u *)line_ga.ga_data + line_ga.ga_len)
|
||||||
{
|
{
|
||||||
if (*p == TAB)
|
if (*p == TAB)
|
||||||
{
|
{
|
||||||
@@ -2309,11 +2321,14 @@ redraw:
|
|||||||
{
|
{
|
||||||
msg_putchar(' ');
|
msg_putchar(' ');
|
||||||
} while (++vcol % 8);
|
} while (++vcol % 8);
|
||||||
|
++p;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
msg_outtrans_len(p, 1);
|
len = MB_PTR2LEN(p);
|
||||||
vcol += char2cells(*p);
|
msg_outtrans_len(p, len);
|
||||||
|
vcol += ptr2cells(p);
|
||||||
|
p += len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
msg_clr_eos();
|
msg_clr_eos();
|
||||||
@@ -2362,7 +2377,16 @@ redraw:
|
|||||||
|
|
||||||
if (IS_SPECIAL(c1))
|
if (IS_SPECIAL(c1))
|
||||||
c1 = '?';
|
c1 = '?';
|
||||||
((char_u *)line_ga.ga_data)[line_ga.ga_len] = c1;
|
#ifdef FEAT_MBYTE
|
||||||
|
if (has_mbyte)
|
||||||
|
len = (*mb_char2bytes)(c1,
|
||||||
|
(char_u *)line_ga.ga_data + line_ga.ga_len);
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
len = 1;
|
||||||
|
((char_u *)line_ga.ga_data)[line_ga.ga_len] = c1;
|
||||||
|
}
|
||||||
if (c1 == '\n')
|
if (c1 == '\n')
|
||||||
msg_putchar('\n');
|
msg_putchar('\n');
|
||||||
else if (c1 == TAB)
|
else if (c1 == TAB)
|
||||||
@@ -2376,10 +2400,10 @@ redraw:
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
msg_outtrans_len(
|
msg_outtrans_len(
|
||||||
((char_u *)line_ga.ga_data) + line_ga.ga_len, 1);
|
((char_u *)line_ga.ga_data) + line_ga.ga_len, len);
|
||||||
vcol += char2cells(c1);
|
vcol += char2cells(c1);
|
||||||
}
|
}
|
||||||
++line_ga.ga_len;
|
line_ga.ga_len += len;
|
||||||
escaped = FALSE;
|
escaped = FALSE;
|
||||||
|
|
||||||
windgoto(msg_row, msg_col);
|
windgoto(msg_row, msg_col);
|
||||||
|
@@ -734,6 +734,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 */
|
||||||
|
/**/
|
||||||
|
324,
|
||||||
/**/
|
/**/
|
||||||
323,
|
323,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user