Merge pull request #2296 from glts/vim-7.4.324

[RDY] vim-patch:7.4.324
This commit is contained in:
Florian Walch 2015-03-31 23:07:13 +03:00
commit 7080041465
2 changed files with 29 additions and 13 deletions

View File

@ -1702,6 +1702,7 @@ getexmodeline (
int vcol = 0; int vcol = 0;
char_u *p; char_u *p;
int prev_char; int prev_char;
int len;
/* always start in column 0; write a newline if necessary */ /* always start in column 0; write a newline if necessary */
compute_cmdrow(); compute_cmdrow();
@ -1761,10 +1762,16 @@ getexmodeline (
if (c1 == '\r') if (c1 == '\r')
c1 = '\n'; c1 = '\n';
if (c1 == BS || c1 == K_BS if (c1 == BS || c1 == K_BS || c1 == DEL || c1 == K_DEL || c1 == K_KDEL) {
|| c1 == DEL || c1 == K_DEL || c1 == K_KDEL) {
if (!GA_EMPTY(&line_ga)) { if (!GA_EMPTY(&line_ga)) {
--line_ga.ga_len; 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 {
line_ga.ga_len--;
}
goto redraw; goto redraw;
} }
continue; continue;
@ -1797,15 +1804,19 @@ 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) {
do { do {
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();
@ -1847,9 +1858,15 @@ redraw:
} }
} }
if (IS_SPECIAL(c1)) if (IS_SPECIAL(c1)) {
c1 = '?'; c1 = '?';
((char_u *)line_ga.ga_data)[line_ga.ga_len] = c1; }
if (has_mbyte) {
len = (*mb_char2bytes)(c1, (char_u *)line_ga.ga_data + line_ga.ga_len);
} else {
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) {
@ -1858,11 +1875,10 @@ redraw:
msg_putchar(' '); msg_putchar(' ');
} while (++vcol % 8); } while (++vcol % 8);
} else { } else {
msg_outtrans_len( msg_outtrans_len(((char_u *)line_ga.ga_data) + line_ga.ga_len, len);
((char_u *)line_ga.ga_data) + line_ga.ga_len, 1);
vcol += char2cells(c1); vcol += char2cells(c1);
} }
++line_ga.ga_len; line_ga.ga_len += len;
escaped = FALSE; escaped = FALSE;
ui_cursor_goto(msg_row, msg_col); ui_cursor_goto(msg_row, msg_col);

View File

@ -416,7 +416,7 @@ static int included_patches[] = {
327, 327,
//326 NA //326 NA
325, 325,
//324, 324,
323, 323,
//322 NA //322 NA
//321 NA //321 NA