diff options
author | Bram Moolenaar <Bram@vim.org> | 2012-10-21 00:58:39 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2012-10-21 00:58:39 +0200 |
commit | b6101cf77f3e9e8cc33a94a0c01db3bcde96eba9 (patch) | |
tree | ffe5ee8321ccde1516dded430ca321ada6c44504 /src/gui_beval.c | |
parent | 2d17fa3ebd378097e3c0feab813a2c60fc9bf474 (diff) | |
download | vim-git-b6101cf77f3e9e8cc33a94a0c01db3bcde96eba9.tar.gz |
updated for version 7.3.695v7.3.695
Problem: Balloon cannot show multi-byte text.
Solution: Properly deal with multi-byte characters. (Dominique Pelle)
Diffstat (limited to 'src/gui_beval.c')
-rw-r--r-- | src/gui_beval.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui_beval.c b/src/gui_beval.c index f9f7e0004..84d6acded 100644 --- a/src/gui_beval.c +++ b/src/gui_beval.c @@ -359,7 +359,7 @@ get_beval_info(beval, getword, winp, lnump, textp, colp) } } - col = vcol2col(wp, lnum, col) - 1; + col = vcol2col(wp, lnum, col); if (VIsual_active && wp->w_buffer == curwin->w_buffer @@ -377,8 +377,10 @@ get_beval_info(beval, getword, winp, lnump, textp, colp) 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')); + 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; } |