On Mo, 25 Aug 2014, Grüner Gimpel wrote:

> I noticed another issue concerning 'listchars' and 'linebreak', and it's also 
> a regression bug from patch 353, but it isn't solved until now (version 
> 7.4.417).
> 
> The issue is that under complicated circumstances, parts of a line disappear.
> Steps to reproduce:
>   1. make sure your Vim is build with the conceal feature enabled
>   2. vim -u test_vimrc test_file
>   3. move the cursor up and down and notice that in the second line the "bla" 
> disappears when the cursor is in line 1
> 
> 
> The relevant files are here: 
> https://gist.github.com/EinfachToll/1868b299ce97af614729

Oh, I hadn't expected that touching the 'linebreak' code would
mess with concealing. Yeah, now I see the problem and I am actually 
surprised this didn't crash.

Thanks for the clear example. The attached patch should fix it
(and contains a test).

Best,
Christian
-- 

-- 
-- 
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
@@ -4514,6 +4514,11 @@ win_line(wp, lnum, startrow, endrow, noc
 			int	i;
 			int	saved_nextra = n_extra;
 
+#ifdef FEAT_CONCEAL
+			if (is_concealing && vcol_off > 0)
+			    /* there are characters to conceal */
+			    tab_len += vcol_off;
+#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 */
@@ -4539,6 +4544,12 @@ win_line(wp, lnum, startrow, endrow, noc
 #endif
 			}
 			p_extra = p_extra_free;
+#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)
+			    n_extra -= vcol_off;
+#endif
 		    }
 #endif
 #ifdef FEAT_CONCEAL
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -2,7 +2,7 @@
 # Makefile to run all tests for Vim
 #
 
-VIMPROG = ../vim
+VIMPROG = ../vim.failed
 SCRIPTSOURCE = ../../runtime
 
 # Uncomment this line to use valgrind for memory leaks and extra warnings.
diff --git a/src/testdir/test_listlbr.in b/src/testdir/test_listlbr.in
--- a/src/testdir/test_listlbr.in
+++ b/src/testdir/test_listlbr.in
@@ -46,6 +46,16 @@ STARTTEST
 :redraw!
 :let line=ScreenChar(winwidth(0))
 :call DoRecordScreen()
+:let line="_S_\t bla"
+:$put =line
+:$
+:norm! zt
+:let g:test ="Test 5: set linebreak with conceal and set list and tab displayed by different char (line may not be truncated)"
+:set cpo&vim list linebreak conceallevel=2 concealcursor=nv listchars=tab:ab
+:syn match ConcealVar contained /_/ conceal
+:syn match All /.*/ contains=ConcealVar
+:let line=ScreenChar(winwidth(0))
+:call DoRecordScreen()
 :%w! test.out
 :qa!
 ENDTEST
diff --git a/src/testdir/test_listlbr.ok b/src/testdir/test_listlbr.ok
--- a/src/testdir/test_listlbr.ok
+++ b/src/testdir/test_listlbr.ok
@@ -25,3 +25,10 @@ 1
 +aaaaaaaaaaaaaaaaaa 
 ~                   
 ~                   
+_S_	 bla
+
+Test 5: set linebreak with conceal and set list and tab displayed by different char (line may not be truncated)
+Sabbbbbb bla        
+~                   
+~                   
+~                   

Raspunde prin e-mail lui