annotate src/testdir/test_display.vim @ 10466:34b50194f82d v8.0.0126

commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 9 19:28:48 2016 +0100 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 #1310)
author Christian Brabandt <cb@256bit.org>
date Fri, 09 Dec 2016 19:30:04 +0100
parents
children 232a0d1d8f24
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
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 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
23
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 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
25
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 call cursor(2, 1)
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 norm! zt
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 redraw!
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 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
30 set fdc=2
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 redraw!
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 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
33 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
34
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 quit!
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 quit!
34b50194f82d commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 endfunction