From 9ab44e74abb7553ad39c13621e0904680e61287d Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Fri, 21 Nov 2014 13:25:54 -0300 Subject: vim-patch:7.4.478: Use character lenght for 'showbreak' vim-patch:7.4.478 Problem: Using byte length instead of character length for 'showbreak'. Solution: Compute the character length. (Marco Hinz) https://code.google.com/p/vim/source/detail?r=v7-4-478 --- src/nvim/charset.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/nvim/charset.c') diff --git a/src/nvim/charset.c b/src/nvim/charset.c index 3e37cbdafd..bbe80a519c 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -1058,8 +1058,11 @@ int win_lbr_chartabsize(win_T *wp, char_u *line, char_u *s, colnr_T col, int *he if (col >= (colnr_T)wp->w_width) { col -= wp->w_width; numberextra = wp->w_width - (numberextra - win_col_off2(wp)); - if (*p_sbr != NUL && col >= (colnr_T)STRLEN(p_sbr)) - col -= (colnr_T)STRLEN(p_sbr); + if (*p_sbr != NUL) { + colnr_T sbrlen = (colnr_T)MB_CHARLEN(p_sbr); + if (col >= sbrlen) + col -= sbrlen; + } if (numberextra > 0) { col = col % numberextra; } -- cgit