annotate src/testdir/test_display.vim @ 10470:232a0d1d8f24 v8.0.0128

commit https://github.com/vim/vim/commit/7089237885218eb8a19805bc2b75481c4efcd6ba Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 9 19:51:49 2016 +0100 patch 8.0.0128 Problem: Display test fails on MS-Windows. Solution: Set 'isprint' to "@".
author Christian Brabandt <cb@256bit.org>
date Fri, 09 Dec 2016 20:00:05 +0100
parents 34b50194f82d
children b25895ab67be
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10466
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test for displaying stuff
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 if !has('gui_running') && has('unix')
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 set term=ansi
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 endif
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 function! s:screenline(lnum, nr) abort
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 let line = []
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 for j in range(a:nr)
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 for c in range(1, winwidth(0))
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 call add(line, nr2char(screenchar(a:lnum+j, c)))
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 endfor
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 call add(line, "\n")
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 endfor
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 return join(line, '')
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 endfunction
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 function! Test_display_foldcolumn()
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 new
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 vnew
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 vert resize 25
10470
232a0d1d8f24 commit https://github.com/vim/vim/commit/7089237885218eb8a19805bc2b75481c4efcd6ba
Christian Brabandt <cb@256bit.org>
parents: 10466
diff changeset
21 call assert_equal(25, winwidth(winnr()))
232a0d1d8f24 commit https://github.com/vim/vim/commit/7089237885218eb8a19805bc2b75481c4efcd6ba
Christian Brabandt <cb@256bit.org>
parents: 10466
diff changeset
22 set isprint=@
10466
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 1put='e more noise blah blah‚ more stuff here'
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 let expect = "e more noise blah blah<82\n> more stuff here \n"
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 call cursor(2, 1)
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 norm! zt
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 redraw!
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 call assert_equal(expect, s:screenline(1,2))
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 set fdc=2
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 redraw!
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 let expect = " e more noise blah blah<\n 82> more stuff here \n"
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 call assert_equal(expect, s:screenline(1,2))
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 quit!
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 quit!
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 endfunction