]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.4.639 v7.4.639
authorBram Moolenaar <Bram@vim.org>
Tue, 17 Feb 2015 16:26:10 +0000 (17:26 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 17 Feb 2015 16:26:10 +0000 (17:26 +0100)
Problem:    Combination of linebreak and conceal doesn't work well.
Solution:   Fix the display problems. (Christian Brabandt)

src/screen.c
src/testdir/test88.in
src/testdir/test88.ok
src/testdir/test_listlbr_utf8.in
src/testdir/test_listlbr_utf8.ok
src/version.c

index f735552b0468b696cb281120693663d05b25ed98..6816503871140477b04e506de4d90c4bebbbd8a7 100644 (file)
@@ -4571,7 +4571,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
                        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, nochange)
 #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 */
index c2e6a752fa9301707cc1a1d28558ad6f78dfd8e9..9e43f703e99f3cc03b700321219f554589ecf6ba 100644 (file)
@@ -71,6 +71,17 @@ GGk
 :set lbr
 :normal $
 GGk
+:set list listchars=tab:>-
+:normal 0
+GGk
+:normal W
+GGk
+:normal W
+GGk
+:normal W
+GGk
+:normal $
+GGk
 :" Display result.
 :call append('$', 'end:')
 :call append('$', positions)
index e29698b7bd30e5e194c9a79ef99b0d0292fc05b0..12949f274a85e15cbbc2f0c3b64cafa7c74bb841 100644 (file)
@@ -22,3 +22,8 @@ end:
 9:25
 9:26
 9:26
+9:1
+9:9
+9:17
+9:25
+9:26
index bb6350ddec2d2b59b2ab2bfc3401418a44892e2b..7448142a6d0024a46fd2df2e6de78e5a72ae94b7 100644 (file)
@@ -56,6 +56,41 @@ STARTTEST
 :redraw!
 :let line=ScreenChar(winwidth(0),7)
 :call DoRecordScreen()
+:let g:test ="Test 5: set linebreak list listchars and concealing part2"
+:let c_defines=['bbeeeeee              ;       some text']
+:call append('$', c_defines)
+:$
+:norm! zt
+:set nowrap ts=2 list linebreak listchars=tab:>- cole=2 concealcursor=n
+:syn clear
+:syn match meaning    /;\s*\zs.*/
+:syn match hasword    /^\x\{8}/    contains=word
+:syn match word       /\<\x\{8}\>/ contains=beginword,endword contained
+:syn match beginword  /\<\x\x/     contained conceal
+:syn match endword    /\x\{6}\>/   contained
+:hi meaning   guibg=blue
+:hi beginword guibg=green
+:hi endword   guibg=red
+:redraw!
+:let line=ScreenChar(winwidth(0),1)
+:call DoRecordScreen()
+:let g:test ="Test 6: Screenattributes for comment"
+:$put =g:test
+:call append('$', ' /*          and some more */')
+:exe "set ft=c ts=7 linebreak list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6"
+:syntax on
+:hi SpecialKey term=underline ctermfg=red guifg=red
+:let attr=[]
+:nnoremap <expr> GG ":let attr += ['".screenattr(screenrow(),screencol())."']\n"
+:$
+:norm! zt0
+GGlGGlGGlGGlGGlGGlGGlGGlGGlGGl
+:call append('$', ['ScreenAttributes for test6:'])
+:if attr[0] != attr[1] && attr[1] != attr[3] && attr[3] != attr[5]
+:   call append('$', "Attribut 0 and 1 and 3 and 5 are different!")
+:else
+:   call append('$', "Not all attributes are different")
+:endif
 :%w! test.out
 :qa!
 ENDTEST
index b90e6969721c4598f330c60b499179db12e2e808..5bd35bdecc0f791534f08ac3db0631276c6bb84d 100644 (file)
@@ -36,3 +36,11 @@ Test 4: set linebreak list listchars and concealing
 #define >_FILE>--------->--->---1       
 #define >_CONSOLE>---------->---2       
 #define >_FILE_AND_CONSOLE>---------3   
+bbeeeeee               ;       some text
+
+Test 5: set linebreak list listchars and concealing part2
+eeeeee>--->-;>some text                 
+Test 6: Screenattributes for comment
+ /*             and some more */
+ScreenAttributes for test6:
+Attribut 0 and 1 and 3 and 5 are different!
index a1f5b66266dbbd6c883e4116884ed0d3a4209529..e92064400ff3b4405c063749c6f414814be1a4d3 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    639,
 /**/
     638,
 /**/