Mercurial > vim
comparison src/ui.c @ 3877:cd6c420e31d6 v7.3.695
updated for version 7.3.695
Problem: Balloon cannot show multi-byte text.
Solution: Properly deal with multi-byte characters. (Dominique Pelle)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 21 Oct 2012 00:58:39 +0200 |
parents | fdac34e3afa5 |
children | 3fd805ca2a6a |
comparison
equal
deleted
inserted
replaced
3876:d73d4a0edc6b | 3877:cd6c420e31d6 |
---|---|
96 } | 96 } |
97 } | 97 } |
98 #endif | 98 #endif |
99 | 99 |
100 /* | 100 /* |
101 * ui_inchar(): low level input funcion. | 101 * ui_inchar(): low level input function. |
102 * Get characters from the keyboard. | 102 * Get characters from the keyboard. |
103 * Return the number of characters that are available. | 103 * Return the number of characters that are available. |
104 * If "wtime" == 0 do not wait for characters. | 104 * If "wtime" == 0 do not wait for characters. |
105 * If "wtime" == -1 wait forever for characters. | 105 * If "wtime" == -1 wait forever for characters. |
106 * If "wtime" > 0 wait "wtime" milliseconds for a character. | 106 * If "wtime" > 0 wait "wtime" milliseconds for a character. |
491 && hl_attr(HLF_V) != hl_attr(HLF_VNC)) | 491 && hl_attr(HLF_V) != hl_attr(HLF_VNC)) |
492 redraw_curbuf_later(INVERTED_ALL); | 492 redraw_curbuf_later(INVERTED_ALL); |
493 } | 493 } |
494 } | 494 } |
495 #else | 495 #else |
496 /* Only own the clibpard when we didn't own it yet. */ | 496 /* Only own the clipboard when we didn't own it yet. */ |
497 if (!cbd->owned && cbd->available) | 497 if (!cbd->owned && cbd->available) |
498 cbd->owned = (clip_gen_own_selection(cbd) == OK); | 498 cbd->owned = (clip_gen_own_selection(cbd) == OK); |
499 #endif | 499 #endif |
500 } | 500 } |
501 | 501 |
3130 int count = 0; | 3130 int count = 0; |
3131 char_u *ptr; | 3131 char_u *ptr; |
3132 char_u *start; | 3132 char_u *start; |
3133 | 3133 |
3134 start = ptr = ml_get_buf(wp->w_buffer, lnum, FALSE); | 3134 start = ptr = ml_get_buf(wp->w_buffer, lnum, FALSE); |
3135 while (count <= vcol && *ptr != NUL) | 3135 while (count < vcol && *ptr != NUL) |
3136 { | 3136 { |
3137 count += win_lbr_chartabsize(wp, ptr, count, NULL); | 3137 count += win_lbr_chartabsize(wp, ptr, count, NULL); |
3138 mb_ptr_adv(ptr); | 3138 mb_ptr_adv(ptr); |
3139 } | 3139 } |
3140 return (int)(ptr - start); | 3140 return (int)(ptr - start); |