Mercurial > vim
comparison src/gui.c @ 474:a5fcf36ef512 v7.0127
updated for version 7.0127
author | vimboss |
---|---|
date | Wed, 10 Aug 2005 21:07:57 +0000 |
parents | 7472c565592a |
children | 6f8b578776ab |
comparison
equal
deleted
inserted
replaced
473:4a7320e53f32 | 474:a5fcf36ef512 |
---|---|
1781 for (this_len = 0; this_len < len; ) | 1781 for (this_len = 0; this_len < len; ) |
1782 { | 1782 { |
1783 cells += (*mb_ptr2cells)(s + this_len); | 1783 cells += (*mb_ptr2cells)(s + this_len); |
1784 if (gui.col + cells > Columns) | 1784 if (gui.col + cells > Columns) |
1785 break; | 1785 break; |
1786 this_len += (*mb_ptr2len_check)(s + this_len); | 1786 this_len += (*mb_ptr2len)(s + this_len); |
1787 } | 1787 } |
1788 if (this_len > len) | 1788 if (this_len > len) |
1789 this_len = len; /* don't include following composing char */ | 1789 this_len = len; /* don't include following composing char */ |
1790 } | 1790 } |
1791 else | 1791 else |
1845 return gui_outstr_nowrap(buf, 2, flags, fg, bg, back); | 1845 return gui_outstr_nowrap(buf, 2, flags, fg, bg, back); |
1846 } | 1846 } |
1847 | 1847 |
1848 /* Draw non-multi-byte character or DBCS character. */ | 1848 /* Draw non-multi-byte character or DBCS character. */ |
1849 return gui_outstr_nowrap(ScreenLines + off, | 1849 return gui_outstr_nowrap(ScreenLines + off, |
1850 enc_dbcs ? (*mb_ptr2len_check)(ScreenLines + off) : 1, | 1850 enc_dbcs ? (*mb_ptr2len)(ScreenLines + off) : 1, |
1851 flags, fg, bg, back); | 1851 flags, fg, bg, back); |
1852 #else | 1852 #else |
1853 return gui_outstr_nowrap(ScreenLines + off, 1, flags, fg, bg, back); | 1853 return gui_outstr_nowrap(ScreenLines + off, 1, flags, fg, bg, back); |
1854 #endif | 1854 #endif |
1855 } | 1855 } |
2188 else | 2188 else |
2189 dowide = FALSE; | 2189 dowide = FALSE; |
2190 comping = utf_iscomposing(c); | 2190 comping = utf_iscomposing(c); |
2191 if (!comping) /* count cells from non-composing chars */ | 2191 if (!comping) /* count cells from non-composing chars */ |
2192 cells += cn; | 2192 cells += cn; |
2193 cl = utf_ptr2len_check(s + i); | 2193 cl = utf_ptr2len(s + i); |
2194 if (cl == 0) /* hit end of string */ | 2194 if (cl == 0) /* hit end of string */ |
2195 len = i + cl; /* len must be wrong "cannot happen" */ | 2195 len = i + cl; /* len must be wrong "cannot happen" */ |
2196 | 2196 |
2197 /* print the string so far if it's the last character or there is | 2197 /* print the string so far if it's the last character or there is |
2198 * a composing character. */ | 2198 * a composing character. */ |
2272 int clen = 0; | 2272 int clen = 0; |
2273 int i; | 2273 int i; |
2274 | 2274 |
2275 /* Get the length in display cells, this can be different from the | 2275 /* Get the length in display cells, this can be different from the |
2276 * number of bytes for "euc-jp". */ | 2276 * number of bytes for "euc-jp". */ |
2277 for (i = 0; i < len; i += (*mb_ptr2len_check)(s + i)) | 2277 for (i = 0; i < len; i += (*mb_ptr2len)(s + i)) |
2278 clen += (*mb_ptr2cells)(s + i); | 2278 clen += (*mb_ptr2cells)(s + i); |
2279 len = clen; | 2279 len = clen; |
2280 } | 2280 } |
2281 # endif | 2281 # endif |
2282 } | 2282 } |
2506 if (enc_dbcs == DBCS_JPNU) | 2506 if (enc_dbcs == DBCS_JPNU) |
2507 { | 2507 { |
2508 /* Stop at a double-byte single-width char. */ | 2508 /* Stop at a double-byte single-width char. */ |
2509 if (ScreenLines[off + idx] == 0x8e) | 2509 if (ScreenLines[off + idx] == 0x8e) |
2510 break; | 2510 break; |
2511 if (len > 1 && (*mb_ptr2len_check)(ScreenLines | 2511 if (len > 1 && (*mb_ptr2len)(ScreenLines |
2512 + off + idx) == 2) | 2512 + off + idx) == 2) |
2513 ++idx; /* skip second byte of double-byte char */ | 2513 ++idx; /* skip second byte of double-byte char */ |
2514 } | 2514 } |
2515 # endif | 2515 # endif |
2516 } | 2516 } |
4557 int what; | 4557 int what; |
4558 { | 4558 { |
4559 while (*text != NUL) | 4559 while (*text != NUL) |
4560 { | 4560 { |
4561 #ifdef FEAT_MBYTE | 4561 #ifdef FEAT_MBYTE |
4562 int l = (*mb_ptr2len_check)(text); | 4562 int l = (*mb_ptr2len)(text); |
4563 if (l > 1) | 4563 if (l > 1) |
4564 { | 4564 { |
4565 while (--l >= 0) | 4565 while (--l >= 0) |
4566 ga_append(gap, *text++); | 4566 ga_append(gap, *text++); |
4567 continue; | 4567 continue; |