From 8721e1fe088943134fe67ee267a9e6b27df291f0 Mon Sep 17 00:00:00 2001 From: watiko Date: Mon, 25 Jan 2016 11:24:58 +0900 Subject: 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) https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b --- src/nvim/screen.c | 28 ++++++++++++++++------------ src/nvim/version.c | 2 +- 2 files changed, 17 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 0d0c645c3d..43bc2c1f68 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -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; diff --git a/src/nvim/version.c b/src/nvim/version.c index 9e2139c297..1efabe9b1b 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -175,7 +175,7 @@ static int included_patches[] = { // 952, // 951, 950, - // 949, + 949, // 948 NA // 947, 946, -- cgit