summaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-03-29 14:40:47 +0200
committerBram Moolenaar <Bram@vim.org>2017-03-29 14:40:47 +0200
commitc6cd8409c2993b1476e123fba11cb4b8d743b896 (patch)
tree8468d7164d26f4120f70d32710e7160e832c3565 /src/screen.c
parentb6fa30ccc39cdb7f1d07b99fe2f4c6b61671dac2 (diff)
downloadvim-git-c6cd8409c2993b1476e123fba11cb4b8d743b896.tar.gz
patch 8.0.0518: bad fold text when a multi-byte char has a zero bytev8.0.0518
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)
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/screen.c b/src/screen.c
index 82c5ba57b..6a7284bb4 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -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)