Skip to content

Commit e299bcd

Browse files
committed
updated for version 7.3.695
Problem: Balloon cannot show multi-byte text. Solution: Properly deal with multi-byte characters. (Dominique Pelle)
1 parent c486394 commit e299bcd

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/gui_beval.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ get_beval_info(beval, getword, winp, lnump, textp, colp)
359359
}
360360
}
361361

362-
col = vcol2col(wp, lnum, col) - 1;
362+
col = vcol2col(wp, lnum, col);
363363

364364
if (VIsual_active
365365
&& wp->w_buffer == curwin->w_buffer
@@ -377,8 +377,10 @@ get_beval_info(beval, getword, winp, lnump, textp, colp)
377377
return FAIL;
378378

379379
lbuf = ml_get_buf(curwin->w_buffer, VIsual.lnum, FALSE);
380-
lbuf = vim_strnsave(lbuf + spos->col,
381-
epos->col - spos->col + (*p_sel != 'e'));
380+
len = epos->col - spos->col;
381+
if (*p_sel != 'e')
382+
len += MB_PTR2LEN(lbuf + epos->col);
383+
lbuf = vim_strnsave(lbuf + spos->col, len);
382384
lnum = spos->lnum;
383385
col = spos->col;
384386
}

src/ui.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ ui_inchar_undo(s, len)
9898
#endif
9999

100100
/*
101-
* ui_inchar(): low level input funcion.
101+
* ui_inchar(): low level input function.
102102
* Get characters from the keyboard.
103103
* Return the number of characters that are available.
104104
* If "wtime" == 0 do not wait for characters.
@@ -493,7 +493,7 @@ clip_own_selection(cbd)
493493
}
494494
}
495495
#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. */
497497
if (!cbd->owned && cbd->available)
498498
cbd->owned = (clip_gen_own_selection(cbd) == OK);
499499
#endif
@@ -3132,7 +3132,7 @@ vcol2col(wp, lnum, vcol)
31323132
char_u *start;
31333133

31343134
start = ptr = ml_get_buf(wp->w_buffer, lnum, FALSE);
3135-
while (count <= vcol && *ptr != NUL)
3135+
while (count < vcol && *ptr != NUL)
31363136
{
31373137
count += win_lbr_chartabsize(wp, ptr, count, NULL);
31383138
mb_ptr_adv(ptr);

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,8 @@ static char *(features[]) =
719719

720720
static int included_patches[] =
721721
{ /* Add new patch number below this line */
722+
/**/
723+
695,
722724
/**/
723725
694,
724726
/**/

0 commit comments

Comments
 (0)