vim-patch:7.4.949

Problem:    When using 'colorcolumn' and there is a sign with a fullwidth
            character the highlighting is wrong. (Andrew Stewart)
Solution:   Only increment vcol when in the right state. (Christian Brabandt)

32a214e78d
This commit is contained in:
watiko
2016-01-25 11:24:58 +09:00
parent 8771e84db7
commit 8721e1fe08
3 changed files with 68 additions and 14 deletions

View File

@@ -3975,20 +3975,24 @@ win_line (
ScreenAttrs[off] = char_attr;
if (has_mbyte && (*mb_char2cells)(mb_c) > 1) {
/* Need to fill two screen columns. */
++off;
++col;
if (enc_utf8)
/* UTF-8: Put a 0 in the second screen char. */
// Need to fill two screen columns.
off++;
col++;
if (enc_utf8) {
// UTF-8: Put a 0 in the second screen char.
ScreenLines[off] = 0;
else
/* DBCS: Put second byte in the second screen char. */
} else {
// DBCS: Put second byte in the second screen char.
ScreenLines[off] = mb_c & 0xff;
++vcol;
/* When "tocol" is halfway through a character, set it to the end of
* the character, otherwise highlighting won't stop. */
if (tocol == vcol)
++tocol;
}
if (draw_state > WL_NR && filler_todo <= 0) {
vcol++;
}
// When "tocol" is halfway through a character, set it to the end of
// the character, otherwise highlighting won't stop.
if (tocol == vcol) {
tocol++;
}
if (wp->w_p_rl) {
/* now it's time to backup one cell */
--off;