summaryrefslogtreecommitdiffstats
path: root/src/screen.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-03-20 15:58:52 +0100
committerBram Moolenaar <Bram@vim.org>2015-03-20 15:58:52 +0100
commit76feaf1bfed170d2fc5c34e7e758885554ecc794 (patch)
treec1b056031960bb3bfdeb5f474cd7eb9350bcbef1 /src/screen.c
parent6b31467aa7f304a80343216c11a1588dff361229 (diff)
updated for version 7.4.665v7.4.665
Problem: 'linebreak' does not work properly with multi-byte characters. Solution: Compute the pointer offset with mb_head_off(). (Yasuhiro Matsumoto)
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/screen.c b/src/screen.c
index 1d4fdd3d95..1addd0ad41 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -4484,11 +4484,15 @@ win_line(wp, lnum, startrow, endrow, nochange)
*/
if (wp->w_p_lbr && vim_isbreak(c) && !vim_isbreak(*ptr))
{
+# ifdef FEAT_MBYTE
+ int off = has_mbyte ? (*mb_head_off)(line, ptr - 1) : 0;
+# endif
char_u *p = ptr - (
# ifdef FEAT_MBYTE
- has_mbyte ? mb_l :
+ off +
# endif
1);
+
/* TODO: is passing p for start of the line OK? */
n_extra = win_lbr_chartabsize(wp, line, p, (colnr_T)vcol,
NULL) - 1;
@@ -4496,7 +4500,11 @@ win_line(wp, lnum, startrow, endrow, nochange)
n_extra = (int)wp->w_buffer->b_p_ts
- vcol % (int)wp->w_buffer->b_p_ts - 1;
+# ifdef FEAT_MBYTE
+ c_extra = off > 0 ? MB_FILLER_CHAR : ' ';
+# else
c_extra = ' ';
+# endif
if (vim_iswhite(c))
{
#ifdef FEAT_CONCEAL