summaryrefslogtreecommitdiffstats
path: root/src/charset.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-10-15 21:26:40 +0200
committerBram Moolenaar <Bram@vim.org>2014-10-15 21:26:40 +0200
commit1c85210d6d0e426b6eb68972f12252804d509dd8 (patch)
tree7047b7ee8fee1df226f6f72e93f1bcbd1b355caa /src/charset.c
parente962c6795be76884f3683d93487fb59d3dae9b0a (diff)
updated for version 7.4.478v7.4.478
Problem: Using byte length instead of character length for 'showbreak'. Solution: Compute the character length. (Marco Hinz)
Diffstat (limited to 'src/charset.c')
-rw-r--r--src/charset.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/charset.c b/src/charset.c
index 006caa2a50..918f9a5142 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1184,8 +1184,12 @@ win_lbr_chartabsize(wp, line, s, col, headp)
{
col -= W_WIDTH(wp);
numberextra = W_WIDTH(wp) - (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;
}