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
committerJustin M. Keyes <justinkz@gmail.com>2017-08-12 17:39:06 +0200
commit1bcb3ed0e29e924167c8429fde2338dd9a6c29d4 (patch)
treeb2c3b92f10be447d5312e37715d5dab7b42e5b79 /src/nvim/screen.c
parentdf02f9cc37be38b8189991f9e76bfcafa6e271c6 (diff)
downloadrneovim-1bcb3ed0e29e924167c8429fde2338dd9a6c29d4.tar.gz
rneovim-1bcb3ed0e29e924167c8429fde2338dd9a6c29d4.tar.bz2
rneovim-1bcb3ed0e29e924167c8429fde2338dd9a6c29d4.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);
+ }
}
}