From 8fc6bc71266e342d339c851b3ee472357f917597 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 17 Feb 2015 17:26:10 +0100 Subject: updated for version 7.4.639 Problem: Combination of linebreak and conceal doesn't work well. Solution: Fix the display problems. (Christian Brabandt) --- src/screen.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'src/screen.c') diff --git a/src/screen.c b/src/screen.c index f735552b0..681650387 100644 --- a/src/screen.c +++ b/src/screen.c @@ -4571,7 +4571,7 @@ win_line(wp, lnum, startrow, endrow, nochange) int saved_nextra = n_extra; #ifdef FEAT_CONCEAL - if ((is_concealing || boguscols > 0) && vcol_off > 0) + if (vcol_off > 0) /* there are characters to conceal */ tab_len += vcol_off; /* boguscols before FIX_FOR_BOGUSCOLS macro from above @@ -4609,25 +4609,30 @@ win_line(wp, lnum, startrow, endrow, nochange) #ifdef FEAT_CONCEAL /* 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; #endif } #endif #ifdef FEAT_CONCEAL - /* 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 (old_boguscols > 0 && n_extra > tab_len && wp->w_p_list + { + 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 += n_extra - tab_len; + tab_len += vc_saved; + } #endif #ifdef FEAT_MBYTE mb_utf8 = FALSE; /* don't draw as UTF-8 */ -- cgit v1.2.1