comparison src/screen.c @ 5923:463ef551e9f6 v7.4.303

updated for version 7.4.303 Problem: When using double-width characters the text displayed on the command line is sometimes truncated. Solution: Reset the string lenght. (Nobuhiro Takasaki)
author Bram Moolenaar <bram@vim.org>
date Thu, 22 May 2014 16:05:19 +0200
parents df141c80ea3a
children 4d7af1962d6c
comparison
equal deleted inserted replaced
5922:7c64a9da0bde 5923:463ef551e9f6
6914 /* 6914 /*
6915 * Like screen_puts(), but output "text[len]". When "len" is -1 output up to 6915 * Like screen_puts(), but output "text[len]". When "len" is -1 output up to
6916 * a NUL. 6916 * a NUL.
6917 */ 6917 */
6918 void 6918 void
6919 screen_puts_len(text, len, row, col, attr) 6919 screen_puts_len(text, textlen, row, col, attr)
6920 char_u *text; 6920 char_u *text;
6921 int len; 6921 int textlen;
6922 int row; 6922 int row;
6923 int col; 6923 int col;
6924 int attr; 6924 int attr;
6925 { 6925 {
6926 unsigned off; 6926 unsigned off;
6927 char_u *ptr = text; 6927 char_u *ptr = text;
6928 int len = textlen;
6928 int c; 6929 int c;
6929 #ifdef FEAT_MBYTE 6930 #ifdef FEAT_MBYTE
6930 unsigned max_off; 6931 unsigned max_off;
6931 int mbyte_blen = 1; 6932 int mbyte_blen = 1;
6932 int mbyte_cells = 1; 6933 int mbyte_cells = 1;
7167 { 7168 {
7168 off += mbyte_cells; 7169 off += mbyte_cells;
7169 col += mbyte_cells; 7170 col += mbyte_cells;
7170 ptr += mbyte_blen; 7171 ptr += mbyte_blen;
7171 if (clear_next_cell) 7172 if (clear_next_cell)
7173 {
7174 /* This only happens at the end, display one space next. */
7172 ptr = (char_u *)" "; 7175 ptr = (char_u *)" ";
7176 len = -1;
7177 }
7173 } 7178 }
7174 else 7179 else
7175 #endif 7180 #endif
7176 { 7181 {
7177 ++off; 7182 ++off;