To: vim_dev@googlegroups.com Subject: Patch 7.3.695 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.3.695 Problem: Balloon cannot show multi-byte text. Solution: Properly deal with multi-byte characters. (Dominique Pelle) Files: src/gui_beval.c, src/ui.c *** ../vim-7.3.694/src/gui_beval.c 2010-08-15 21:57:28.000000000 +0200 --- src/gui_beval.c 2012-10-21 00:54:19.000000000 +0200 *************** *** 359,365 **** } } ! col = vcol2col(wp, lnum, col) - 1; if (VIsual_active && wp->w_buffer == curwin->w_buffer --- 359,365 ---- } } ! col = vcol2col(wp, lnum, col); if (VIsual_active && wp->w_buffer == curwin->w_buffer *************** *** 377,384 **** return FAIL; lbuf = ml_get_buf(curwin->w_buffer, VIsual.lnum, FALSE); ! lbuf = vim_strnsave(lbuf + spos->col, ! epos->col - spos->col + (*p_sel != 'e')); lnum = spos->lnum; col = spos->col; } --- 377,386 ---- return FAIL; lbuf = ml_get_buf(curwin->w_buffer, VIsual.lnum, FALSE); ! len = epos->col - spos->col; ! if (*p_sel != 'e') ! len += MB_PTR2LEN(lbuf + epos->col); ! lbuf = vim_strnsave(lbuf + spos->col, len); lnum = spos->lnum; col = spos->col; } *** ../vim-7.3.694/src/ui.c 2012-08-29 16:26:01.000000000 +0200 --- src/ui.c 2012-10-21 00:50:17.000000000 +0200 *************** *** 98,104 **** #endif /* ! * ui_inchar(): low level input funcion. * Get characters from the keyboard. * Return the number of characters that are available. * If "wtime" == 0 do not wait for characters. --- 98,104 ---- #endif /* ! * ui_inchar(): low level input function. * Get characters from the keyboard. * Return the number of characters that are available. * If "wtime" == 0 do not wait for characters. *************** *** 493,499 **** } } #else ! /* Only own the clibpard when we didn't own it yet. */ if (!cbd->owned && cbd->available) cbd->owned = (clip_gen_own_selection(cbd) == OK); #endif --- 493,499 ---- } } #else ! /* Only own the clipboard when we didn't own it yet. */ if (!cbd->owned && cbd->available) cbd->owned = (clip_gen_own_selection(cbd) == OK); #endif *************** *** 3132,3138 **** char_u *start; start = ptr = ml_get_buf(wp->w_buffer, lnum, FALSE); ! while (count <= vcol && *ptr != NUL) { count += win_lbr_chartabsize(wp, ptr, count, NULL); mb_ptr_adv(ptr); --- 3132,3138 ---- char_u *start; start = ptr = ml_get_buf(wp->w_buffer, lnum, FALSE); ! while (count < vcol && *ptr != NUL) { count += win_lbr_chartabsize(wp, ptr, count, NULL); mb_ptr_adv(ptr); *** ../vim-7.3.694/src/version.c 2012-10-21 00:44:59.000000000 +0200 --- src/version.c 2012-10-21 00:50:32.000000000 +0200 *************** *** 721,722 **** --- 721,724 ---- { /* Add new patch number below this line */ + /**/ + 695, /**/ -- BEDEVERE: Why do you think she is a witch? SECOND VILLAGER: She turned me into a newt. BEDEVERE: A newt? SECOND VILLAGER: (After looking at himself for some time) I got better. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///