diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/screen.c | 38 | ||||
-rw-r--r-- | src/nvim/testdir/test88.in | 11 | ||||
-rw-r--r-- | src/nvim/testdir/test88.ok | 5 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
4 files changed, 39 insertions, 17 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index c6d1ea790e..0d0c645c3d 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -3410,7 +3410,7 @@ win_line ( int i; int saved_nextra = n_extra; - if ((is_concealing || boguscols > 0) && vcol_off > 0) { + if (vcol_off > 0) { // there are characters to conceal tab_len += vcol_off; } @@ -3440,25 +3440,31 @@ win_line ( // n_extra will be increased by FIX_FOX_BOGUSCOLS // macro below, so need to adjust for that here - if ((is_concealing || boguscols > 0) && vcol_off > 0) { + if (vcol_off > 0) { n_extra -= vcol_off; } } - /* Tab alignment should be identical regardless of - * 'conceallevel' value. So tab compensates of all - * previous concealed characters, and thus resets vcol_off - * and boguscols accumulated so far in the line. Note that - * the tab can be longer than 'tabstop' when there - * are concealed characters. */ - FIX_FOR_BOGUSCOLS; - // Make sure that the highlighting for the tab char will be correctly - // set further below (effectively reverts the FIX_FOR_BOGSUCOLS - // macro). - if (old_boguscols > 0 && n_extra > tab_len && wp->w_p_list - && lcs_tab1) { - tab_len += n_extra - tab_len; + + { + int vc_saved = vcol_off; + + // Tab alignment should be identical regardless of + // 'conceallevel' value. So tab compensates of all + // previous concealed characters, and thus resets + // vcol_off and boguscols accumulated so far in the + // line. Note that the tab can be longer than + // 'tabstop' when there are concealed characters. + FIX_FOR_BOGUSCOLS; + + // Make sure, the highlighting for the tab char will be + // correctly set further below (effectively reverts the + // FIX_FOR_BOGSUCOLS macro. + if (n_extra == tab_len + vc_saved && wp->w_p_list && lcs_tab1) { + tab_len += vc_saved; + } } - mb_utf8 = FALSE; /* don't draw as UTF-8 */ + + mb_utf8 = (int)false; // don't draw as UTF-8 if (wp->w_p_list) { c = lcs_tab1; if (wp->w_p_lbr) { diff --git a/src/nvim/testdir/test88.in b/src/nvim/testdir/test88.in index c2e6a752fa..9e43f703e9 100644 --- a/src/nvim/testdir/test88.in +++ b/src/nvim/testdir/test88.in @@ -71,6 +71,17 @@ GGk :set lbr :normal $ GGk +:set list listchars=tab:>- +:normal 0 +GGk +:normal W +GGk +:normal W +GGk +:normal W +GGk +:normal $ +GGk :" Display result. :call append('$', 'end:') :call append('$', positions) diff --git a/src/nvim/testdir/test88.ok b/src/nvim/testdir/test88.ok index e29698b7bd..12949f274a 100644 --- a/src/nvim/testdir/test88.ok +++ b/src/nvim/testdir/test88.ok @@ -22,3 +22,8 @@ end: 9:25 9:26 9:26 +9:1 +9:9 +9:17 +9:25 +9:26 diff --git a/src/nvim/version.c b/src/nvim/version.c index bf1986d3ba..2ffe41d6fd 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -485,7 +485,7 @@ static int included_patches[] = { 642, // 641 NA 640, - // 639, + 639, // 638 NA 637, 636, |