Mercurial > vim
annotate src/testdir/test_display.vim @ 11020:50f3e37bc210 v8.0.0399
patch 8.0.0399: crash when using balloon_show() when not supported
commit https://github.com/vim/vim/commit/caf6434ac937cf26050276d7b474be2d2d6a06b3
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Mar 2 22:11:33 2017 +0100
patch 8.0.0399: crash when using balloon_show() when not supported
Problem: Crash when using balloon_show() when not supported. (Hirohito
Higashi)
Solution: Check for balloonEval not to be NULL. (Ken Takata)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 02 Mar 2017 22:15:04 +0100 |
parents | 232a0d1d8f24 |
children | b25895ab67be |
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 |