mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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)
6270660611
This commit is contained in:
parent
df02f9cc37
commit
1bcb3ed0e2
@ -2705,15 +2705,20 @@ win_line (
|
|||||||
|
|
||||||
draw_state = WL_FOLD;
|
draw_state = WL_FOLD;
|
||||||
if (fdc > 0) {
|
if (fdc > 0) {
|
||||||
// Draw the 'foldcolumn'.
|
// Draw the 'foldcolumn'. Allocate a buffer, "extra" may
|
||||||
fill_foldcolumn(extra, wp, false, lnum);
|
// 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;
|
n_extra = fdc;
|
||||||
p_extra = extra;
|
p_extra_free[n_extra] = NUL;
|
||||||
p_extra[n_extra] = NUL;
|
p_extra = p_extra_free;
|
||||||
c_extra = NUL;
|
c_extra = NUL;
|
||||||
char_attr = win_hl_attr(wp, HLF_FC);
|
char_attr = win_hl_attr(wp, HLF_FC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//sign column
|
//sign column
|
||||||
if (draw_state == WL_SIGN - 1 && n_extra == 0) {
|
if (draw_state == WL_SIGN - 1 && n_extra == 0) {
|
||||||
|
37
src/nvim/testdir/test_display.vim
Normal file
37
src/nvim/testdir/test_display.vim
Normal file
@ -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
|
@ -826,7 +826,7 @@ static const int included_patches[] = {
|
|||||||
// 129 NA
|
// 129 NA
|
||||||
// 128,
|
// 128,
|
||||||
127,
|
127,
|
||||||
// 126,
|
126,
|
||||||
// 125,
|
// 125,
|
||||||
124,
|
124,
|
||||||
// 123 NA
|
// 123 NA
|
||||||
|
Loading…
Reference in New Issue
Block a user