Mercurial > vim
annotate src/testdir/test_display.vim @ 12261:875d7cc9b127 v8.0.1010
patch 8.0.1010: build failure without termresponse feature
commit https://github.com/vim/vim/commit/3c37a8e66008aadfe428a32ecf46aab4b9e285ae
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Aug 28 23:00:55 2017 +0200
patch 8.0.1010: build failure without termresponse feature
Problem: Build failure without termresponse feature.
Solution: Add #ifdef.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 28 Aug 2017 23:15:04 +0200 |
parents | f26a535d9464 |
children | 63b02fcf1361 |
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 |
11265
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
6 source view_util.vim |
10466
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 |
11265
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
8 func! Test_display_foldcolumn() |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
9 if !has("folding") |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
10 return |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
11 endif |
10466
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 new |
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 vnew |
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 vert resize 25 |
10470
232a0d1d8f24
commit https://github.com/vim/vim/commit/7089237885218eb8a19805bc2b75481c4efcd6ba
Christian Brabandt <cb@256bit.org>
parents:
10466
diff
changeset
|
15 call assert_equal(25, winwidth(winnr())) |
232a0d1d8f24
commit https://github.com/vim/vim/commit/7089237885218eb8a19805bc2b75481c4efcd6ba
Christian Brabandt <cb@256bit.org>
parents:
10466
diff
changeset
|
16 set isprint=@ |
10466
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 |
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 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
|
19 |
11265
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
20 let expect = [ |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
21 \ "e more noise blah blah<82", |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
22 \ "> more stuff here " |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
23 \ ] |
10466
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 |
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 call cursor(2, 1) |
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 norm! zt |
11265
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
27 let lines=ScreenLines([1,2], winwidth(0)) |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
28 call assert_equal(expect, lines) |
10466
34b50194f82d
commit https://github.com/vim/vim/commit/6270660611a151c5d0f614a5f0248ccdc80ed971
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 set fdc=2 |
11265
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
30 let lines=ScreenLines([1,2], winwidth(0)) |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
31 let expect = [ |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
32 \ " e more noise blah blah<", |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
33 \ " 82> more stuff here " |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
34 \ ] |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
35 call assert_equal(expect, lines) |
10466
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! |
11265
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
39 endfunc |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
40 |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
41 func! Test_display_foldtext_mbyte() |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
42 if !has("folding") || !has("multi_byte") |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
43 return |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
44 endif |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
45 call NewWindow(10, 40) |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
46 call append(0, range(1,20)) |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
47 exe "set foldmethod=manual foldtext=foldtext() fillchars=fold:\u2500,vert:\u2502 fdc=2" |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
48 call cursor(2, 1) |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
49 norm! zf13G |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
50 let lines=ScreenLines([1,3], winwidth(0)+1) |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
51 let expect=[ |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
52 \ " 1 \u2502", |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
53 \ "+ +-- 12 lines: 2". repeat("\u2500", 23). "\u2502", |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
54 \ " 14 \u2502", |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
55 \ ] |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
56 call assert_equal(expect, lines) |
11277
f26a535d9464
patch 8.0.0524: folds messed up
Christian Brabandt <cb@256bit.org>
parents:
11265
diff
changeset
|
57 |
f26a535d9464
patch 8.0.0524: folds messed up
Christian Brabandt <cb@256bit.org>
parents:
11265
diff
changeset
|
58 set fillchars=fold:-,vert:\| |
f26a535d9464
patch 8.0.0524: folds messed up
Christian Brabandt <cb@256bit.org>
parents:
11265
diff
changeset
|
59 let lines=ScreenLines([1,3], winwidth(0)+1) |
f26a535d9464
patch 8.0.0524: folds messed up
Christian Brabandt <cb@256bit.org>
parents:
11265
diff
changeset
|
60 let expect=[ |
f26a535d9464
patch 8.0.0524: folds messed up
Christian Brabandt <cb@256bit.org>
parents:
11265
diff
changeset
|
61 \ " 1 |", |
f26a535d9464
patch 8.0.0524: folds messed up
Christian Brabandt <cb@256bit.org>
parents:
11265
diff
changeset
|
62 \ "+ +-- 12 lines: 2". repeat("-", 23). "|", |
f26a535d9464
patch 8.0.0524: folds messed up
Christian Brabandt <cb@256bit.org>
parents:
11265
diff
changeset
|
63 \ " 14 |", |
f26a535d9464
patch 8.0.0524: folds messed up
Christian Brabandt <cb@256bit.org>
parents:
11265
diff
changeset
|
64 \ ] |
f26a535d9464
patch 8.0.0524: folds messed up
Christian Brabandt <cb@256bit.org>
parents:
11265
diff
changeset
|
65 call assert_equal(expect, lines) |
f26a535d9464
patch 8.0.0524: folds messed up
Christian Brabandt <cb@256bit.org>
parents:
11265
diff
changeset
|
66 |
11265
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
67 set foldtext& fillchars& foldmethod& fdc& |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
68 bw! |
b25895ab67be
patch 8.0.0518: bad fold text when a multi-byte char has a zero byte
Christian Brabandt <cb@256bit.org>
parents:
10470
diff
changeset
|
69 endfunc |