Bram Moolenaar | 6270660 | 2016-12-09 19:28:48 +0100 | [diff] [blame] | 1 | " Test for displaying stuff |
| 2 | if !has('gui_running') && has('unix') |
| 3 | set term=ansi |
| 4 | endif |
| 5 | |
| 6 | function! s:screenline(lnum, nr) abort |
| 7 | let line = [] |
| 8 | for j in range(a:nr) |
| 9 | for c in range(1, winwidth(0)) |
| 10 | call add(line, nr2char(screenchar(a:lnum+j, c))) |
| 11 | endfor |
| 12 | call add(line, "\n") |
| 13 | endfor |
| 14 | return join(line, '') |
| 15 | endfunction |
| 16 | |
| 17 | function! Test_display_foldcolumn() |
| 18 | new |
| 19 | vnew |
| 20 | vert resize 25 |
Bram Moolenaar | 7089237 | 2016-12-09 19:51:49 +0100 | [diff] [blame] | 21 | call assert_equal(25, winwidth(winnr())) |
| 22 | set isprint=@ |
Bram Moolenaar | 6270660 | 2016-12-09 19:28:48 +0100 | [diff] [blame] | 23 | |
| 24 | 1put='e more noise blah blah‚ more stuff here' |
| 25 | |
| 26 | let expect = "e more noise blah blah<82\n> more stuff here \n" |
| 27 | |
| 28 | call cursor(2, 1) |
| 29 | norm! zt |
| 30 | redraw! |
| 31 | call assert_equal(expect, s:screenline(1,2)) |
| 32 | set fdc=2 |
| 33 | redraw! |
| 34 | let expect = " e more noise blah blah<\n 82> more stuff here \n" |
| 35 | call assert_equal(expect, s:screenline(1,2)) |
| 36 | |
| 37 | quit! |
| 38 | quit! |
| 39 | endfunction |