diff src/screen.c @ 6520:70793fedd25a v7.4.587

updated for version 7.4.587 Problem: Conceal does not work properly with 'linebreak'. (cs86661) Solution: Save and restore boguscols. (Christian Brabandt)
author Bram Moolenaar <bram@vim.org>
date Tue, 20 Jan 2015 19:01:35 +0100
parents 134a7d55f9fa
children 0c8738124a7b
line wrap: on
line diff
--- a/src/screen.c
+++ b/src/screen.c
@@ -3003,6 +3003,7 @@ win_line(wp, lnum, startrow, endrow, noc
 					   wrapping */
     int		vcol_off	= 0;	/* offset for concealed characters */
     int		did_wcol	= FALSE;
+    int		old_boguscols   = 0;
 # define VCOL_HLC (vcol - vcol_off)
 # define FIX_FOR_BOGUSCOLS \
     { \
@@ -3010,6 +3011,7 @@ win_line(wp, lnum, startrow, endrow, noc
 	vcol -= vcol_off; \
 	vcol_off = 0; \
 	col -= boguscols; \
+	old_boguscols = boguscols; \
 	boguscols = 0; \
     }
 #else
@@ -4545,10 +4547,16 @@ win_line(wp, lnum, startrow, endrow, noc
 			int	saved_nextra = n_extra;
 
 #ifdef FEAT_CONCEAL
-			if (is_concealing && vcol_off > 0)
+			if ((is_concealing || boguscols > 0) && vcol_off > 0)
 			    /* there are characters to conceal */
 			    tab_len += vcol_off;
-#endif
+			/* boguscols before FIX_FOR_BOGUSCOLS macro from above
+			 */
+			if (wp->w_p_list && lcs_tab1 && old_boguscols > 0
+							 && n_extra > tab_len)
+			    tab_len += n_extra - tab_len;
+#endif
+
 			/* if n_extra > 0, it gives the number of chars, to
 			 * use for a tab, else we need to calculate the width
 			 * for a tab */
@@ -4577,7 +4585,7 @@ 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 && vcol_off > 0)
+			if ((is_concealing || boguscols > 0) && vcol_off > 0)
 			    n_extra -= vcol_off;
 #endif
 		    }
@@ -4590,6 +4598,12 @@ win_line(wp, lnum, startrow, endrow, noc
 		     * 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
+								  && lcs_tab1)
+			tab_len += n_extra - tab_len;
 #endif
 #ifdef FEAT_MBYTE
 		    mb_utf8 = FALSE;	/* don't draw as UTF-8 */