Problem: Display problem with 'foldcolumn' and a wide character.
(esiegerman)
Solution: Don't use "extra" but an allocated buffer. (Christian Brabandt,
closes #1310)
test_delete \
test_diffmode \
test_digraph \
+ test_display \
test_ex_undo \
test_execute_func \
test_expand \
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
test_cscope.res \
test_diffmode.res \
test_digraph.res \
+ test_display.res \
test_farsi.res \
test_fnameescape.res \
test_gf.res \
--- /dev/null
+" Test for displaying stuff
+if !has('gui_running') && has('unix')
+ set term=ansi
+endif
+
+function! s:screenline(lnum, nr) abort
+ let line = []
+ for j in range(a:nr)
+ for c in range(1, winwidth(0))
+ call add(line, nr2char(screenchar(a:lnum+j, c)))
+ endfor
+ call add(line, "\n")
+ endfor
+ return join(line, '')
+endfunction
+
+function! Test_display_foldcolumn()
+ new
+ vnew
+ vert resize 25
+
+ 1put='e more noise blah blah\82 more stuff here'
+
+ let expect = "e more noise blah blah<82\n> more stuff here \n"
+
+ call cursor(2, 1)
+ norm! zt
+ redraw!
+ call assert_equal(expect, s:screenline(1,2))
+ set fdc=2
+ redraw!
+ let expect = " e more noise blah blah<\n 82> more stuff here \n"
+ call assert_equal(expect, s:screenline(1,2))
+
+ quit!
+ quit!
+endfunction
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 126,
/**/
125,
/**/