Mercurial > vim
diff src/screen.c @ 10466:34b50194f82d v8.0.0126
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Dec 9 19:28:48 2016 +0100
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 #1310)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 09 Dec 2016 19:30:04 +0100 |
parents | 957a1d560bda |
children | c7f671dfd735 |
line wrap: on
line diff
--- a/src/screen.c +++ b/src/screen.c @@ -3649,13 +3649,19 @@ 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 = hl_attr(HLF_FC); + /* Draw the 'foldcolumn'. Allocate a buffer, "extra" may + * already be in used. */ + p_extra_free = alloc(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 = hl_attr(HLF_FC); + } } } #endif