2016-12-09 19:28:48 +01:00
|
|
|
|
" Test for displaying stuff
|
|
|
|
|
|
if !has('gui_running') && has('unix')
|
|
|
|
|
|
set term=ansi
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
2017-03-29 14:40:47 +02:00
|
|
|
|
source view_util.vim
|
2016-12-09 19:28:48 +01:00
|
|
|
|
|
2019-01-09 23:01:02 +01:00
|
|
|
|
func Test_display_foldcolumn()
|
2017-03-29 14:40:47 +02:00
|
|
|
|
if !has("folding")
|
|
|
|
|
|
return
|
|
|
|
|
|
endif
|
2016-12-09 19:28:48 +01:00
|
|
|
|
new
|
|
|
|
|
|
vnew
|
|
|
|
|
|
vert resize 25
|
2016-12-09 19:51:49 +01:00
|
|
|
|
call assert_equal(25, winwidth(winnr()))
|
|
|
|
|
|
set isprint=@
|
2016-12-09 19:28:48 +01:00
|
|
|
|
|
|
|
|
|
|
1put='e more noise blah blah more stuff here'
|
|
|
|
|
|
|
2017-03-29 14:40:47 +02:00
|
|
|
|
let expect = [
|
|
|
|
|
|
\ "e more noise blah blah<82",
|
|
|
|
|
|
\ "> more stuff here "
|
|
|
|
|
|
\ ]
|
2016-12-09 19:28:48 +01:00
|
|
|
|
|
|
|
|
|
|
call cursor(2, 1)
|
|
|
|
|
|
norm! zt
|
2017-03-29 14:40:47 +02:00
|
|
|
|
let lines=ScreenLines([1,2], winwidth(0))
|
|
|
|
|
|
call assert_equal(expect, lines)
|
2016-12-09 19:28:48 +01:00
|
|
|
|
set fdc=2
|
2017-03-29 14:40:47 +02:00
|
|
|
|
let lines=ScreenLines([1,2], winwidth(0))
|
|
|
|
|
|
let expect = [
|
|
|
|
|
|
\ " e more noise blah blah<",
|
|
|
|
|
|
\ " 82> more stuff here "
|
|
|
|
|
|
\ ]
|
|
|
|
|
|
call assert_equal(expect, lines)
|
2016-12-09 19:28:48 +01:00
|
|
|
|
|
|
|
|
|
|
quit!
|
|
|
|
|
|
quit!
|
2017-03-29 14:40:47 +02:00
|
|
|
|
endfunc
|
|
|
|
|
|
|
2019-01-09 23:01:02 +01:00
|
|
|
|
func Test_display_foldtext_mbyte()
|
2019-01-24 17:59:39 +01:00
|
|
|
|
if !has("folding")
|
2017-03-29 14:40:47 +02:00
|
|
|
|
return
|
|
|
|
|
|
endif
|
|
|
|
|
|
call NewWindow(10, 40)
|
|
|
|
|
|
call append(0, range(1,20))
|
|
|
|
|
|
exe "set foldmethod=manual foldtext=foldtext() fillchars=fold:\u2500,vert:\u2502 fdc=2"
|
|
|
|
|
|
call cursor(2, 1)
|
|
|
|
|
|
norm! zf13G
|
|
|
|
|
|
let lines=ScreenLines([1,3], winwidth(0)+1)
|
|
|
|
|
|
let expect=[
|
|
|
|
|
|
\ " 1 \u2502",
|
|
|
|
|
|
\ "+ +-- 12 lines: 2". repeat("\u2500", 23). "\u2502",
|
|
|
|
|
|
\ " 14 \u2502",
|
|
|
|
|
|
\ ]
|
|
|
|
|
|
call assert_equal(expect, lines)
|
2017-03-29 20:38:59 +02:00
|
|
|
|
|
|
|
|
|
|
set fillchars=fold:-,vert:\|
|
|
|
|
|
|
let lines=ScreenLines([1,3], winwidth(0)+1)
|
|
|
|
|
|
let expect=[
|
|
|
|
|
|
\ " 1 |",
|
|
|
|
|
|
\ "+ +-- 12 lines: 2". repeat("-", 23). "|",
|
|
|
|
|
|
\ " 14 |",
|
|
|
|
|
|
\ ]
|
|
|
|
|
|
call assert_equal(expect, lines)
|
|
|
|
|
|
|
2017-03-29 14:40:47 +02:00
|
|
|
|
set foldtext& fillchars& foldmethod& fdc&
|
|
|
|
|
|
bw!
|
|
|
|
|
|
endfunc
|