aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/screen.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-07-29 01:44:58 +0200
committerJustin M. Keyes <justinkz@gmail.com>2017-08-12 17:39:07 +0200
commitcddd4e613e2fefaa1c3fe8c20617f5ee02845617 (patch)
treea1f1a5b38e5606f352160b3e8e5ffcc3b8649c1c /src/nvim/screen.c
parent49b671f8f1c93dcd317aec464352206cc705748a (diff)
downloadrneovim-cddd4e613e2fefaa1c3fe8c20617f5ee02845617.tar.gz
rneovim-cddd4e613e2fefaa1c3fe8c20617f5ee02845617.tar.bz2
rneovim-cddd4e613e2fefaa1c3fe8c20617f5ee02845617.zip
vim-patch:8.0.0518
Closes #7086 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 vim/vim#1567) https://github.com/vim/vim/commit/c6cd8409c2993b1476e123fba11cb4b8d743b896
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r--src/nvim/screen.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index 27701c4643..c302ac695e 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -1924,10 +1924,14 @@ static void fold_line(win_T *wp, long fold_count, foldinfo_T *foldinfo, linenr_T
if (fill_fold >= 0x80) {
ScreenLinesUC[off + col] = fill_fold;
ScreenLinesC[0][off + col] = 0;
- } else
+ ScreenLines[off + col] = 0x80; // avoid storing zero
+ } else {
ScreenLinesUC[off + col] = 0;
+ }
+ col++;
+ } else {
+ ScreenLines[off + col++] = fill_fold;
}
- ScreenLines[off + col++] = fill_fold;
}
if (text != buf)