Karsten Hopp 1f8932
To: vim_dev@googlegroups.com
Karsten Hopp 1f8932
Subject: Patch 7.4.639
Karsten Hopp 1f8932
Fcc: outbox
Karsten Hopp 1f8932
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 1f8932
Mime-Version: 1.0
Karsten Hopp 1f8932
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 1f8932
Content-Transfer-Encoding: 8bit
Karsten Hopp 1f8932
------------
Karsten Hopp 1f8932
Karsten Hopp 1f8932
Patch 7.4.639
Karsten Hopp 1f8932
Problem:    Combination of linebreak and conceal doesn't work well.
Karsten Hopp 1f8932
Solution:   Fix the display problems. (Christian Brabandt)
Karsten Hopp 1f8932
Files:	    src/screen.c, src/testdir/test88.in, src/testdir/test88.ok,
Karsten Hopp 1f8932
	    src/testdir/test_listlbr_utf8.in, src/testdir/test_listlbr_utf8.ok
Karsten Hopp 1f8932
Karsten Hopp 1f8932
Karsten Hopp 1f8932
*** ../vim-7.4.638/src/screen.c	2015-02-10 19:20:33.735792024 +0100
Karsten Hopp 1f8932
--- src/screen.c	2015-02-17 17:25:05.241891264 +0100
Karsten Hopp 1f8932
***************
Karsten Hopp 1f8932
*** 4571,4577 ****
Karsten Hopp 1f8932
  			int	saved_nextra = n_extra;
Karsten Hopp 1f8932
  
Karsten Hopp 1f8932
  #ifdef FEAT_CONCEAL
Karsten Hopp 1f8932
! 			if ((is_concealing || boguscols > 0) && vcol_off > 0)
Karsten Hopp 1f8932
  			    /* there are characters to conceal */
Karsten Hopp 1f8932
  			    tab_len += vcol_off;
Karsten Hopp 1f8932
  			/* boguscols before FIX_FOR_BOGUSCOLS macro from above
Karsten Hopp 1f8932
--- 4571,4577 ----
Karsten Hopp 1f8932
  			int	saved_nextra = n_extra;
Karsten Hopp 1f8932
  
Karsten Hopp 1f8932
  #ifdef FEAT_CONCEAL
Karsten Hopp 1f8932
! 			if (vcol_off > 0)
Karsten Hopp 1f8932
  			    /* there are characters to conceal */
Karsten Hopp 1f8932
  			    tab_len += vcol_off;
Karsten Hopp 1f8932
  			/* boguscols before FIX_FOR_BOGUSCOLS macro from above
Karsten Hopp 1f8932
***************
Karsten Hopp 1f8932
*** 4609,4633 ****
Karsten Hopp 1f8932
  #ifdef FEAT_CONCEAL
Karsten Hopp 1f8932
  			/* n_extra will be increased by FIX_FOX_BOGUSCOLS
Karsten Hopp 1f8932
  			 * macro below, so need to adjust for that here */
Karsten Hopp 1f8932
! 			if ((is_concealing || boguscols > 0) && vcol_off > 0)
Karsten Hopp 1f8932
  			    n_extra -= vcol_off;
Karsten Hopp 1f8932
  #endif
Karsten Hopp 1f8932
  		    }
Karsten Hopp 1f8932
  #endif
Karsten Hopp 1f8932
  #ifdef FEAT_CONCEAL
Karsten Hopp 1f8932
! 		    /* Tab alignment should be identical regardless of
Karsten Hopp 1f8932
! 		     * 'conceallevel' value. So tab compensates of all
Karsten Hopp 1f8932
! 		     * previous concealed characters, and thus resets vcol_off
Karsten Hopp 1f8932
! 		     * and boguscols accumulated so far in the line. Note that
Karsten Hopp 1f8932
! 		     * the tab can be longer than 'tabstop' when there
Karsten Hopp 1f8932
! 		     * are concealed characters. */
Karsten Hopp 1f8932
! 		    FIX_FOR_BOGUSCOLS;
Karsten Hopp 1f8932
! 		    /* Make sure, the highlighting for the tab char will be
Karsten Hopp 1f8932
! 		     * correctly set further below (effectively reverts the
Karsten Hopp 1f8932
! 		     * FIX_FOR_BOGSUCOLS macro */
Karsten Hopp 1f8932
! 		    if (old_boguscols > 0 && n_extra > tab_len && wp->w_p_list
Karsten Hopp 1f8932
  								  && lcs_tab1)
Karsten Hopp 1f8932
! 			tab_len += n_extra - tab_len;
Karsten Hopp 1f8932
  #endif
Karsten Hopp 1f8932
  #ifdef FEAT_MBYTE
Karsten Hopp 1f8932
  		    mb_utf8 = FALSE;	/* don't draw as UTF-8 */
Karsten Hopp 1f8932
--- 4609,4638 ----
Karsten Hopp 1f8932
  #ifdef FEAT_CONCEAL
Karsten Hopp 1f8932
  			/* n_extra will be increased by FIX_FOX_BOGUSCOLS
Karsten Hopp 1f8932
  			 * macro below, so need to adjust for that here */
Karsten Hopp 1f8932
! 			if (vcol_off > 0)
Karsten Hopp 1f8932
  			    n_extra -= vcol_off;
Karsten Hopp 1f8932
  #endif
Karsten Hopp 1f8932
  		    }
Karsten Hopp 1f8932
  #endif
Karsten Hopp 1f8932
  #ifdef FEAT_CONCEAL
Karsten Hopp 1f8932
! 		    {
Karsten Hopp 1f8932
! 			int vc_saved = vcol_off;
Karsten Hopp 1f8932
! 
Karsten Hopp 1f8932
! 			/* Tab alignment should be identical regardless of
Karsten Hopp 1f8932
! 			 * 'conceallevel' value. So tab compensates of all
Karsten Hopp 1f8932
! 			 * previous concealed characters, and thus resets
Karsten Hopp 1f8932
! 			 * vcol_off and boguscols accumulated so far in the
Karsten Hopp 1f8932
! 			 * line. Note that the tab can be longer than
Karsten Hopp 1f8932
! 			 * 'tabstop' when there are concealed characters. */
Karsten Hopp 1f8932
! 			FIX_FOR_BOGUSCOLS;
Karsten Hopp 1f8932
! 
Karsten Hopp 1f8932
! 			/* Make sure, the highlighting for the tab char will be
Karsten Hopp 1f8932
! 			 * correctly set further below (effectively reverts the
Karsten Hopp 1f8932
! 			 * FIX_FOR_BOGSUCOLS macro */
Karsten Hopp 1f8932
! 			if (n_extra == tab_len + vc_saved && wp->w_p_list
Karsten Hopp 1f8932
  								  && lcs_tab1)
Karsten Hopp 1f8932
! 			    tab_len += vc_saved;
Karsten Hopp 1f8932
! 		    }
Karsten Hopp 1f8932
  #endif
Karsten Hopp 1f8932
  #ifdef FEAT_MBYTE
Karsten Hopp 1f8932
  		    mb_utf8 = FALSE;	/* don't draw as UTF-8 */
Karsten Hopp 1f8932
*** ../vim-7.4.638/src/testdir/test88.in	2013-07-13 12:17:37.000000000 +0200
Karsten Hopp 1f8932
--- src/testdir/test88.in	2015-02-17 17:17:40.903640757 +0100
Karsten Hopp 1f8932
***************
Karsten Hopp 1f8932
*** 71,76 ****
Karsten Hopp 1f8932
--- 71,87 ----
Karsten Hopp 1f8932
  :set lbr
Karsten Hopp 1f8932
  :normal $
Karsten Hopp 1f8932
  GGk
Karsten Hopp 1f8932
+ :set list listchars=tab:>-
Karsten Hopp 1f8932
+ :normal 0
Karsten Hopp 1f8932
+ GGk
Karsten Hopp 1f8932
+ :normal W
Karsten Hopp 1f8932
+ GGk
Karsten Hopp 1f8932
+ :normal W
Karsten Hopp 1f8932
+ GGk
Karsten Hopp 1f8932
+ :normal W
Karsten Hopp 1f8932
+ GGk
Karsten Hopp 1f8932
+ :normal $
Karsten Hopp 1f8932
+ GGk
Karsten Hopp 1f8932
  :" Display result.
Karsten Hopp 1f8932
  :call append('$', 'end:')
Karsten Hopp 1f8932
  :call append('$', positions)
Karsten Hopp 1f8932
*** ../vim-7.4.638/src/testdir/test88.ok	2013-07-13 12:18:55.000000000 +0200
Karsten Hopp 1f8932
--- src/testdir/test88.ok	2015-02-17 17:17:40.903640757 +0100
Karsten Hopp 1f8932
***************
Karsten Hopp 1f8932
*** 22,24 ****
Karsten Hopp 1f8932
--- 22,29 ----
Karsten Hopp 1f8932
  9:25
Karsten Hopp 1f8932
  9:26
Karsten Hopp 1f8932
  9:26
Karsten Hopp 1f8932
+ 9:1
Karsten Hopp 1f8932
+ 9:9
Karsten Hopp 1f8932
+ 9:17
Karsten Hopp 1f8932
+ 9:25
Karsten Hopp 1f8932
+ 9:26
Karsten Hopp 1f8932
*** ../vim-7.4.638/src/testdir/test_listlbr_utf8.in	2015-01-22 22:41:51.864583029 +0100
Karsten Hopp 1f8932
--- src/testdir/test_listlbr_utf8.in	2015-02-17 17:17:40.903640757 +0100
Karsten Hopp 1f8932
***************
Karsten Hopp 1f8932
*** 56,61 ****
Karsten Hopp 1f8932
--- 56,96 ----
Karsten Hopp 1f8932
  :redraw!
Karsten Hopp 1f8932
  :let line=ScreenChar(winwidth(0),7)
Karsten Hopp 1f8932
  :call DoRecordScreen()
Karsten Hopp 1f8932
+ :let g:test ="Test 5: set linebreak list listchars and concealing part2"
Karsten Hopp 1f8932
+ :let c_defines=['bbeeeeee		;	some text']
Karsten Hopp 1f8932
+ :call append('$', c_defines)
Karsten Hopp 1f8932
+ :$
Karsten Hopp 1f8932
+ :norm! zt
Karsten Hopp 1f8932
+ :set nowrap ts=2 list linebreak listchars=tab:>- cole=2 concealcursor=n
Karsten Hopp 1f8932
+ :syn clear
Karsten Hopp 1f8932
+ :syn match meaning    /;\s*\zs.*/
Karsten Hopp 1f8932
+ :syn match hasword    /^\x\{8}/    contains=word
Karsten Hopp 1f8932
+ :syn match word       /\<\x\{8}\>/ contains=beginword,endword contained
Karsten Hopp 1f8932
+ :syn match beginword  /\<\x\x/     contained conceal
Karsten Hopp 1f8932
+ :syn match endword    /\x\{6}\>/   contained
Karsten Hopp 1f8932
+ :hi meaning   guibg=blue
Karsten Hopp 1f8932
+ :hi beginword guibg=green
Karsten Hopp 1f8932
+ :hi endword   guibg=red
Karsten Hopp 1f8932
+ :redraw!
Karsten Hopp 1f8932
+ :let line=ScreenChar(winwidth(0),1)
Karsten Hopp 1f8932
+ :call DoRecordScreen()
Karsten Hopp 1f8932
+ :let g:test ="Test 6: Screenattributes for comment"
Karsten Hopp 1f8932
+ :$put =g:test
Karsten Hopp 1f8932
+ :call append('$', ' /*		 and some more */')
Karsten Hopp 1f8932
+ :exe "set ft=c ts=7 linebreak list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6"
Karsten Hopp 1f8932
+ :syntax on
Karsten Hopp 1f8932
+ :hi SpecialKey term=underline ctermfg=red guifg=red
Karsten Hopp 1f8932
+ :let attr=[]
Karsten Hopp 1f8932
+ :nnoremap <expr> GG ":let attr += ['".screenattr(screenrow(),screencol())."']\n"
Karsten Hopp 1f8932
+ :$
Karsten Hopp 1f8932
+ :norm! zt0
Karsten Hopp 1f8932
+ GGlGGlGGlGGlGGlGGlGGlGGlGGlGGl
Karsten Hopp 1f8932
+ :call append('$', ['ScreenAttributes for test6:'])
Karsten Hopp 1f8932
+ :if attr[0] != attr[1] && attr[1] != attr[3] && attr[3] != attr[5]
Karsten Hopp 1f8932
+ :   call append('$', "Attribut 0 and 1 and 3 and 5 are different!")
Karsten Hopp 1f8932
+ :else
Karsten Hopp 1f8932
+ :   call append('$', "Not all attributes are different")
Karsten Hopp 1f8932
+ :endif
Karsten Hopp 1f8932
  :%w! test.out
Karsten Hopp 1f8932
  :qa!
Karsten Hopp 1f8932
  ENDTEST
Karsten Hopp 1f8932
*** ../vim-7.4.638/src/testdir/test_listlbr_utf8.ok	2015-01-20 19:01:32.380444290 +0100
Karsten Hopp 1f8932
--- src/testdir/test_listlbr_utf8.ok	2015-02-17 17:17:40.903640757 +0100
Karsten Hopp 1f8932
***************
Karsten Hopp 1f8932
*** 36,38 ****
Karsten Hopp 1f8932
--- 36,46 ----
Karsten Hopp 1f8932
  #define >_FILE>--------->--->---1       
Karsten Hopp 1f8932
  #define >_CONSOLE>---------->---2       
Karsten Hopp 1f8932
  #define >_FILE_AND_CONSOLE>---------3   
Karsten Hopp 1f8932
+ bbeeeeee		;	some text
Karsten Hopp 1f8932
+ 
Karsten Hopp 1f8932
+ Test 5: set linebreak list listchars and concealing part2
Karsten Hopp 1f8932
+ eeeeee>--->-;>some text                 
Karsten Hopp 1f8932
+ Test 6: Screenattributes for comment
Karsten Hopp 1f8932
+  /*		 and some more */
Karsten Hopp 1f8932
+ ScreenAttributes for test6:
Karsten Hopp 1f8932
+ Attribut 0 and 1 and 3 and 5 are different!
Karsten Hopp 1f8932
*** ../vim-7.4.638/src/version.c	2015-02-17 16:28:51.369508298 +0100
Karsten Hopp 1f8932
--- src/version.c	2015-02-17 17:16:55.980222281 +0100
Karsten Hopp 1f8932
***************
Karsten Hopp 1f8932
*** 743,744 ****
Karsten Hopp 1f8932
--- 743,746 ----
Karsten Hopp 1f8932
  {   /* Add new patch number below this line */
Karsten Hopp 1f8932
+ /**/
Karsten Hopp 1f8932
+     639,
Karsten Hopp 1f8932
  /**/
Karsten Hopp 1f8932
Karsten Hopp 1f8932
-- 
Karsten Hopp 1f8932
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 1f8932
244. You use more than 20 passwords.
Karsten Hopp 1f8932
Karsten Hopp 1f8932
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 1f8932
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 1f8932
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 1f8932
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///