diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-07-08 23:30:22 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-07-08 23:30:22 +0200 |
commit | 3dabd718f4b2d8e09de9e2ec73832620b91c2f79 (patch) | |
tree | d8dc80b5d6b1a718537d688fcf906418289f4212 /src/mbyte.c | |
parent | 8a7383b6d28be02413cf115d4b8ed1b44d60dd9f (diff) | |
download | vim-git-3dabd718f4b2d8e09de9e2ec73832620b91c2f79.tar.gz |
patch 8.1.1655: popup window border drawn wrong with multi-byte charv8.1.1655
Problem: Popup window border drawn wrong with multi-byte char. (Marcin
Szamotulski)
Solution: Correct check in mb_fix_col(). (closes #4635)
Diffstat (limited to 'src/mbyte.c')
-rw-r--r-- | src/mbyte.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mbyte.c b/src/mbyte.c index 94adddf7e..2b7640066 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -4266,14 +4266,18 @@ mb_lefthalve(int row, int col) int mb_fix_col(int col, int row) { + int off; + col = check_col(col); row = check_row(row); + off = LineOffset[row] + col; if (has_mbyte && ScreenLines != NULL && col > 0 && ((enc_dbcs - && ScreenLines[LineOffset[row] + col] != NUL + && ScreenLines[off] != NUL && dbcs_screen_head_off(ScreenLines + LineOffset[row], - ScreenLines + LineOffset[row] + col)) - || (enc_utf8 && ScreenLines[LineOffset[row] + col] == 0))) + ScreenLines + off)) + || (enc_utf8 && ScreenLines[off] == 0 + && ScreenLinesUC[off] == 0))) return col - 1; return col; } |