comparison src/screen.c @ 1340:8e42199f5121 v7.1.054

updated for version 7.1-054
author vimboss
date Sun, 05 Aug 2007 18:10:54 +0000
parents d51bf80e8fc9
children a4365075d05c
comparison
equal deleted inserted replaced
1339:3bfd2e1e2609 1340:8e42199f5121
2553 int row; /* row in the window, excl w_winrow */ 2553 int row; /* row in the window, excl w_winrow */
2554 int screen_row; /* row on the screen, incl w_winrow */ 2554 int screen_row; /* row on the screen, incl w_winrow */
2555 2555
2556 char_u extra[18]; /* "%ld" and 'fdc' must fit in here */ 2556 char_u extra[18]; /* "%ld" and 'fdc' must fit in here */
2557 int n_extra = 0; /* number of extra chars */ 2557 int n_extra = 0; /* number of extra chars */
2558 char_u *p_extra = NULL; /* string of extra chars */ 2558 char_u *p_extra = NULL; /* string of extra chars, plus NUL */
2559 int c_extra = NUL; /* extra chars, all the same */ 2559 int c_extra = NUL; /* extra chars, all the same */
2560 int extra_attr = 0; /* attributes when n_extra != 0 */ 2560 int extra_attr = 0; /* attributes when n_extra != 0 */
2561 static char_u *at_end_str = (char_u *)""; /* used for p_extra when 2561 static char_u *at_end_str = (char_u *)""; /* used for p_extra when
2562 displaying lcs_eol at end-of-line */ 2562 displaying lcs_eol at end-of-line */
2563 int lcs_eol_one = lcs_eol; /* lcs_eol until it's been used */ 2563 int lcs_eol_one = lcs_eol; /* lcs_eol until it's been used */
3187 { 3187 {
3188 draw_state = WL_CMDLINE; 3188 draw_state = WL_CMDLINE;
3189 if (cmdwin_type != 0 && wp == curwin) 3189 if (cmdwin_type != 0 && wp == curwin)
3190 { 3190 {
3191 /* Draw the cmdline character. */ 3191 /* Draw the cmdline character. */
3192 *extra = cmdwin_type;
3193 n_extra = 1; 3192 n_extra = 1;
3194 p_extra = extra; 3193 c_extra = cmdwin_type;
3195 c_extra = NUL;
3196 char_attr = hl_attr(HLF_AT); 3194 char_attr = hl_attr(HLF_AT);
3197 } 3195 }
3198 } 3196 }
3199 #endif 3197 #endif
3200 3198
3206 { 3204 {
3207 /* Draw the 'foldcolumn'. */ 3205 /* Draw the 'foldcolumn'. */
3208 fill_foldcolumn(extra, wp, FALSE, lnum); 3206 fill_foldcolumn(extra, wp, FALSE, lnum);
3209 n_extra = wp->w_p_fdc; 3207 n_extra = wp->w_p_fdc;
3210 p_extra = extra; 3208 p_extra = extra;
3209 p_extra[n_extra] = NUL;
3211 c_extra = NUL; 3210 c_extra = NUL;
3212 char_attr = hl_attr(HLF_FC); 3211 char_attr = hl_attr(HLF_FC);
3213 } 3212 }
3214 } 3213 }
3215 #endif 3214 #endif
3548 3547
3549 /* 3548 /*
3550 * Get the next character to put on the screen. 3549 * Get the next character to put on the screen.
3551 */ 3550 */
3552 /* 3551 /*
3553 * The 'extra' array contains the extra stuff that is inserted to 3552 * The "p_extra" points to the extra stuff that is inserted to
3554 * represent special characters (non-printable stuff). When all 3553 * represent special characters (non-printable stuff) and other
3555 * characters are the same, c_extra is used. 3554 * things. When all characters are the same, c_extra is used.
3555 * "p_extra" must end in a NUL to avoid mb_ptr2len() reads past
3556 * "p_extra[n_extra]".
3556 * For the '$' of the 'list' option, n_extra == 1, p_extra == "". 3557 * For the '$' of the 'list' option, n_extra == 1, p_extra == "".
3557 */ 3558 */
3558 if (n_extra > 0) 3559 if (n_extra > 0)
3559 { 3560 {
3560 if (c_extra != NUL) 3561 if (c_extra != NUL)
3806 3807
3807 /* If a double-width char doesn't fit at the left side display 3808 /* If a double-width char doesn't fit at the left side display
3808 * a '<' in the first column. */ 3809 * a '<' in the first column. */
3809 if (n_skip > 0 && mb_l > 1) 3810 if (n_skip > 0 && mb_l > 1)
3810 { 3811 {
3811 extra[0] = '<';
3812 p_extra = extra;
3813 n_extra = 1; 3812 n_extra = 1;
3814 c_extra = NUL; 3813 c_extra = '<';
3815 c = ' '; 3814 c = ' ';
3816 if (area_attr == 0 && search_attr == 0) 3815 if (area_attr == 0 && search_attr == 0)
3817 { 3816 {
3818 n_attr = n_extra + 1; 3817 n_attr = n_extra + 1;
3819 extra_attr = hl_attr(HLF_AT); 3818 extra_attr = hl_attr(HLF_AT);
6202 6201
6203 if (ScreenLines == NULL || row >= screen_Rows) /* safety check */ 6202 if (ScreenLines == NULL || row >= screen_Rows) /* safety check */
6204 return; 6203 return;
6205 6204
6206 off = LineOffset[row] + col; 6205 off = LineOffset[row] + col;
6207 while (*ptr != NUL && col < screen_Columns 6206 while (col < screen_Columns
6208 && (len < 0 || (int)(ptr - text) < len)) 6207 && (len < 0 || (int)(ptr - text) < len)
6208 && *ptr != NUL)
6209 { 6209 {
6210 c = *ptr; 6210 c = *ptr;
6211 #ifdef FEAT_MBYTE 6211 #ifdef FEAT_MBYTE
6212 /* check if this is the first byte of a multibyte */ 6212 /* check if this is the first byte of a multibyte */
6213 if (has_mbyte) 6213 if (has_mbyte)