Mercurial > vim
comparison src/mbyte.c @ 17312:484424955bfa v8.1.1655
patch 8.1.1655: popup window border drawn wrong with multi-byte char
commit https://github.com/vim/vim/commit/3dabd718f4b2d8e09de9e2ec73832620b91c2f79
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jul 8 23:30:22 2019 +0200
patch 8.1.1655: popup window border drawn wrong with multi-byte char
Problem: Popup window border drawn wrong with multi-byte char. (Marcin
Szamotulski)
Solution: Correct check in mb_fix_col(). (closes #4635)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 08 Jul 2019 23:45:04 +0200 |
parents | 49ef396af986 |
children | 8ae333756614 |
comparison
equal
deleted
inserted
replaced
17311:bfb4d8e3544d | 17312:484424955bfa |
---|---|
4264 * char move it to the left half. Returns the corrected column. | 4264 * char move it to the left half. Returns the corrected column. |
4265 */ | 4265 */ |
4266 int | 4266 int |
4267 mb_fix_col(int col, int row) | 4267 mb_fix_col(int col, int row) |
4268 { | 4268 { |
4269 int off; | |
4270 | |
4269 col = check_col(col); | 4271 col = check_col(col); |
4270 row = check_row(row); | 4272 row = check_row(row); |
4273 off = LineOffset[row] + col; | |
4271 if (has_mbyte && ScreenLines != NULL && col > 0 | 4274 if (has_mbyte && ScreenLines != NULL && col > 0 |
4272 && ((enc_dbcs | 4275 && ((enc_dbcs |
4273 && ScreenLines[LineOffset[row] + col] != NUL | 4276 && ScreenLines[off] != NUL |
4274 && dbcs_screen_head_off(ScreenLines + LineOffset[row], | 4277 && dbcs_screen_head_off(ScreenLines + LineOffset[row], |
4275 ScreenLines + LineOffset[row] + col)) | 4278 ScreenLines + off)) |
4276 || (enc_utf8 && ScreenLines[LineOffset[row] + col] == 0))) | 4279 || (enc_utf8 && ScreenLines[off] == 0 |
4280 && ScreenLinesUC[off] == 0))) | |
4277 return col - 1; | 4281 return col - 1; |
4278 return col; | 4282 return col; |
4279 } | 4283 } |
4280 | 4284 |
4281 static int enc_alias_search(char_u *name); | 4285 static int enc_alias_search(char_u *name); |