diff src/screen.c @ 6627:43f444efe6a2 v7.4.639

updated for version 7.4.639 Problem: Combination of linebreak and conceal doesn't work well. Solution: Fix the display problems. (Christian Brabandt)
author Bram Moolenaar <bram@vim.org>
date Tue, 17 Feb 2015 17:26:10 +0100
parents c77ef1bf9623
children 27d9a4d8c168
line wrap: on
line diff
--- a/src/screen.c
+++ b/src/screen.c
@@ -4571,7 +4571,7 @@ win_line(wp, lnum, startrow, endrow, noc
 			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, noc
 #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 */