Skip to content

Commit 8da1e6c

Browse files
committed
patch 8.0.0524: folds messed up
Problem: Folds are messed up when 'encodin' is "utf-8". Solution: Also set the fold character when it's not multi-byte.
1 parent bf3d580 commit 8da1e6c

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/screen.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2700,7 +2700,10 @@ fold_line(
27002700
ScreenLines[off + col] = 0x80; /* avoid storing zero */
27012701
}
27022702
else
2703+
{
27032704
ScreenLinesUC[off + col] = 0;
2705+
ScreenLines[off + col] = fill_fold;
2706+
}
27042707
col++;
27052708
}
27062709
else

src/testdir/test_display.vim

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ func! Test_display_foldtext_mbyte()
5454
\ " 14 \u2502",
5555
\ ]
5656
call assert_equal(expect, lines)
57+
58+
set fillchars=fold:-,vert:\|
59+
let lines=ScreenLines([1,3], winwidth(0)+1)
60+
let expect=[
61+
\ " 1 |",
62+
\ "+ +-- 12 lines: 2". repeat("-", 23). "|",
63+
\ " 14 |",
64+
\ ]
65+
call assert_equal(expect, lines)
66+
5767
set foldtext& fillchars& foldmethod& fdc&
5868
bw!
5969
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
524,
767769
/**/
768770
523,
769771
/**/

0 commit comments

Comments
 (0)