1
0
forked from aniani/vim

patch 8.0.0518: bad fold text when a multi-byte char has a zero byte

Problem:    Storing a zero byte from a multi-byte character causes fold text
            to show up wrong.
Solution:   Avoid putting zero in ScreenLines. (Christian Brabandt,
            closes #1567)
This commit is contained in:
Bram Moolenaar
2017-03-29 14:40:47 +02:00
parent b6fa30ccc3
commit c6cd8409c2
3 changed files with 44 additions and 19 deletions

View File

@@ -2697,12 +2697,15 @@ fold_line(
{
ScreenLinesUC[off + col] = fill_fold;
ScreenLinesC[0][off + col] = 0;
ScreenLines[off + col] = 0x80; /* avoid storing zero */
}
else
ScreenLinesUC[off + col] = 0;
col++;
}
else
#endif
ScreenLines[off + col++] = fill_fold;
ScreenLines[off + col++] = fill_fold;
}
if (text != buf)