vim-patch:7.4.303 #818

Problem:    When using double-width characters the text displayed on the
            command line is sometimes truncated.
Solution:   Reset the string lenght. (Nobuhiro Takasaki)

https://code.google.com/p/vim/source/detail?r=463ef551e9f62b63ac3f85f1f297b668b14bcd09
This commit is contained in:
oni-link 2014-05-22 16:39:21 +02:00 committed by Justin M. Keyes
parent c388737957
commit 4ccf1125ff
2 changed files with 7 additions and 3 deletions

View File

@ -5215,10 +5215,11 @@ void screen_puts(char_u *text, int row, int col, int attr)
* Like screen_puts(), but output "text[len]". When "len" is -1 output up to
* a NUL.
*/
void screen_puts_len(char_u *text, int len, int row, int col, int attr)
void screen_puts_len(char_u *text, int textlen, int row, int col, int attr)
{
unsigned off;
char_u *ptr = text;
int len = textlen;
int c;
unsigned max_off;
int mbyte_blen = 1;
@ -5404,8 +5405,11 @@ void screen_puts_len(char_u *text, int len, int row, int col, int attr)
off += mbyte_cells;
col += mbyte_cells;
ptr += mbyte_blen;
if (clear_next_cell)
if (clear_next_cell) {
// This only happens at the end, display one space next.
ptr = (char_u *)" ";
len = -1;
}
} else {
++off;
++col;

View File

@ -215,7 +215,7 @@ static int included_patches[] = {
//306,
//305,
//304,
//303,
303,
302,
301,
//300,