On Mi, 07 Dez 2016, Christian Brabandt wrote: > ah yes I can reproduce it. Will look into it. thanks.
Here is a patch. Best, Christian -- Das Leben ist wie eine Achterbahn. Mal wird Dir schlecht, mal willst Du nochmal fahren. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
From 068425f19e61ee37b08321dadbbec896962f710b Mon Sep 17 00:00:00 2001 From: Christian Brabandt <c...@256bit.org> Date: Wed, 7 Dec 2016 21:52:54 +0100 Subject: [PATCH] Fix Redrawing bug when fdc is set --- src/screen.c | 17 +++++++++++------ src/testdir/Make_all.mak | 1 + src/testdir/test_display.vim | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 src/testdir/test_display.vim diff --git a/src/screen.c b/src/screen.c index 45e7c7c..86d04fa 100644 --- a/src/screen.c +++ b/src/screen.c @@ -3650,12 +3650,17 @@ win_line( 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); + 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 diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak index 17c70f3..c78e34b 100644 --- a/src/testdir/Make_all.mak +++ b/src/testdir/Make_all.mak @@ -148,6 +148,7 @@ NEW_TESTS = test_arglist.res \ test_cscope.res \ test_diffmode.res \ test_digraph.res \ + test_display.res \ test_farsi.res \ test_fnameescape.res \ test_gf.res \ diff --git a/src/testdir/test_display.vim b/src/testdir/test_display.vim new file mode 100644 index 0000000..ba7b7d7 --- /dev/null +++ b/src/testdir/test_display.vim @@ -0,0 +1,37 @@ +" 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‚ 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 -- 2.10.2