On Di, 09 Dez 2014, cs86661 wrote:

> example:
> 
> 1. open test.c.
> 
> 2. change settings.
> :set list
> :set listchars=tab:\|-
> :syntax match Conceal conceal cchar=> 'AB'
> :set conceallevel=1
> 
> 3. problem setting, some chars disappeared ?!
> :set lbr
> 

> #include <stdio.h>
> 
> #define ABC           1
> #define ABCD          1
> #define ABCDE         1
> 
> #define AB_C  1
> #define AB_CD 1
> #define AB_CDE        1
> 
> int main()
> {
>   return 0;
> }

Concealing, linebreak and listlbr features are getting considerably 
complex. It is hard to understand what is going on.

I made a patch, that I think fixes this bug and includes a test as well, 
but understanding that part of the line drawing code is quite complex. I 
hope this doesn't cause any problems.

Best,
Christian
-- 
Ist der Begriff "Selbsthilfegruppe" nicht widersinnig?

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/screen.c b/src/screen.c
--- a/src/screen.c
+++ b/src/screen.c
@@ -3000,6 +3000,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 \
     { \
@@ -3007,6 +3008,7 @@ win_line(wp, lnum, startrow, endrow, noc
 	vcol -= vcol_off; \
 	vcol_off = 0; \
 	col -= boguscols; \
+	old_boguscols = boguscols; \
 	boguscols = 0; \
     }
 #else
@@ -4527,10 +4529,14 @@ 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 (tab_len == 0 && (old_boguscols > 0))
+			    tab_len = (int)wp->w_buffer->b_p_ts;
+#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 */
@@ -4559,7 +4565,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
 		    }
diff --git a/src/testdir/test_listlbr_utf8.in b/src/testdir/test_listlbr_utf8.in
--- a/src/testdir/test_listlbr_utf8.in
+++ b/src/testdir/test_listlbr_utf8.in
@@ -45,7 +45,17 @@ STARTTEST
 :redraw!
 :let line=ScreenChar(winwidth(0))
 :call DoRecordScreen()
-:"
+:let g:test ="Test 4: set linebreak list listchars and concealing"
+:let c_defines=['#define ABCDE		1','#define ABCDEF		1','#define ABCDEFG		1','#define ABCDEFGH	1']
+:call append('$', c_defines)
+:vert resize 30
+:$-3
+:norm! zt
+:set list linebreak listchars=tab:>- cole=1
+:syn match Conceal conceal cchar=>'AB'
+:redraw!
+:let line=ScreenChar(winwidth(0))
+:call DoRecordScreen()
 :%w! test.out
 :qa!
 ENDTEST
diff --git a/src/testdir/test_listlbr_utf8.ok b/src/testdir/test_listlbr_utf8.ok
--- a/src/testdir/test_listlbr_utf8.ok
+++ b/src/testdir/test_listlbr_utf8.ok
@@ -19,3 +19,13 @@ Test 3: set linebreak nolist
 ~                   
 ~                   
 ~                   
+#define ABCDE		1
+#define ABCDEF		1
+#define ABCDEFG		1
+#define ABCDEFGH	1
+
+Test 4: set linebreak list listchars and concealing
+#define ABCDE>-->---1         
+#define >CDEF>-->---1         
+#define >CDEFG>->---1         
+#define >CDEFGH>----1         

Raspunde prin e-mail lui