aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/screen.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-07-29 02:26:21 +0200
committerckelsel <ckelsel@hotmail.com>2017-08-14 07:45:49 +0800
commitdfd45f26f14179c6a4c75f06814c0ff6c0792349 (patch)
treeb2c3b92f10be447d5312e37715d5dab7b42e5b79 /src/nvim/screen.c
parent5e66c429e33db1c9a272c273cb3ad95c9bf64627 (diff)
downloadrneovim-dfd45f26f14179c6a4c75f06814c0ff6c0792349.tar.gz
rneovim-dfd45f26f14179c6a4c75f06814c0ff6c0792349.tar.bz2
rneovim-dfd45f26f14179c6a4c75f06814c0ff6c0792349.zip
vim-patch:8.0.0126
Problem: Display problem with 'foldcolumn' and a wide character. (esiegerman) Solution: Don't use "extra" but an allocated buffer. (Christian Brabandt, closes vim/vim#1310) https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r--src/nvim/screen.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index e3a2c1ffec..3d558bdbdd 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -2705,13 +2705,18 @@ win_line (
draw_state = WL_FOLD;
if (fdc > 0) {
- // Draw the 'foldcolumn'.
- fill_foldcolumn(extra, wp, false, lnum);
- n_extra = fdc;
- p_extra = extra;
- p_extra[n_extra] = NUL;
- c_extra = NUL;
- char_attr = win_hl_attr(wp, HLF_FC);
+ // Draw the 'foldcolumn'. Allocate a buffer, "extra" may
+ // already be in used.
+ p_extra_free = xmalloc(12 + 1);
+
+ if (p_extra_free != NULL) {
+ fill_foldcolumn(p_extra_free, wp, false, lnum);
+ n_extra = fdc;
+ p_extra_free[n_extra] = NUL;
+ p_extra = p_extra_free;
+ c_extra = NUL;
+ char_attr = win_hl_attr(wp, HLF_FC);
+ }
}
}