]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.0.0524: folds messed up v8.0.0524
authorBram Moolenaar <Bram@vim.org>
Wed, 29 Mar 2017 18:38:59 +0000 (20:38 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 29 Mar 2017 18:38:59 +0000 (20:38 +0200)
Problem:    Folds are messed up when 'encodin' is "utf-8".
Solution:   Also set the fold character when it's not multi-byte.

src/screen.c
src/testdir/test_display.vim
src/version.c

index ceb30e337deb5b382a1a9eef7c4ffb8c2d5f7ce6..fbfded1a295b5e7cfef345ce2d3e892a780066f2 100644 (file)
@@ -2700,7 +2700,10 @@ fold_line(
                 ScreenLines[off + col] = 0x80; /* avoid storing zero */
            }
            else
+           {
                ScreenLinesUC[off + col] = 0;
+               ScreenLines[off + col] = fill_fold;
+           }
            col++;
        }
        else
index 4253b56933f5b38d6ad29c22ee6cfb5745498890..48b7a2318e1d5674fa7c3b370c585b0bb9be076d 100644 (file)
@@ -54,6 +54,16 @@ func! Test_display_foldtext_mbyte()
         \ "  14                                    \u2502",
         \ ]
   call assert_equal(expect, lines)
+
+  set fillchars=fold:-,vert:\|
+  let lines=ScreenLines([1,3], winwidth(0)+1)
+  let expect=[
+        \ "  1                                     |",
+        \ "+ +-- 12 lines: 2". repeat("-", 23). "|",
+        \ "  14                                    |",
+        \ ]
+  call assert_equal(expect, lines)
+
   set foldtext& fillchars& foldmethod& fdc&
   bw!
 endfunc
index c3f1189367491af8e940495df2cefbbfa83581fc..f490deba10986958425695cf717072ee483a48c2 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    524,
 /**/
     523,
 /**/