Mercurial > vim
annotate src/testdir/test_listchars.vim @ 29597:f2d7f20d83c3 v9.0.0139
patch 9.0.0139: truncating virtual text after a line not implemented
Commit: https://github.com/vim/vim/commit/398649ee44edeb309c77361de697320378104b70
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Aug 4 15:03:48 2022 +0100
patch 9.0.0139: truncating virtual text after a line not implemented
Problem: Truncating virtual text after a line not implemented.
Cursor positioning wrong with Newline in the text.
Solution: Implement truncating. Disallow control characters in the text.
(closes #10842)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 04 Aug 2022 16:15:08 +0200 |
parents | 9b292596a332 |
children | f08ed0738f7a |
rev | line source |
---|---|
12851
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for 'listchars' display with 'list' and :list |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
25170
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
3 source check.vim |
12851
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 source view_util.vim |
25170
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
5 source screendump.vim |
12851
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 func Test_listchars() |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 enew! |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 set ff=unix |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 set list |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 set listchars+=tab:>-,space:.,trail:< |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 call append(0, [ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 \ ' aa ', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 \ ' bb ', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 \ ' cccc ', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 \ 'dd ee ', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 \ ' ' |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 \ ]) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 let expected = [ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 \ '>-------aa>-----$', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 \ '..bb>---<<$', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 \ '...cccc><$', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 \ 'dd........ee<<>-$', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 \ '<$' |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 \ ] |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 redraw! |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 for i in range(1, 5) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 call cursor(i, 1) |
18035
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17742
diff
changeset
|
30 call assert_equal([expected[i - 1]], ScreenLines(i, '$'->virtcol())) |
12851
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 endfor |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 set listchars-=trail:< |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 let expected = [ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 \ '>-------aa>-----$', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 \ '..bb>---..$', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 \ '...cccc>.$', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 \ 'dd........ee..>-$', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 \ '.$' |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 \ ] |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 redraw! |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 for i in range(1, 5) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 call cursor(i, 1) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
44 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$'))) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
45 endfor |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 |
15502
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
47 " tab with 3rd character. |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
48 set listchars-=tab:>- |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
49 set listchars+=tab:<=>,trail:- |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
50 let expected = [ |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
51 \ '<======>aa<====>$', |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
52 \ '..bb<==>--$', |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
53 \ '...cccc>-$', |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
54 \ 'dd........ee--<>$', |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
55 \ '-$' |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
56 \ ] |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
57 redraw! |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
58 for i in range(1, 5) |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
59 call cursor(i, 1) |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
60 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$'))) |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
61 endfor |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
62 |
17742
a51ccadd0dca
patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
16592
diff
changeset
|
63 " tab with 3rd character and linebreak set |
a51ccadd0dca
patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
16592
diff
changeset
|
64 set listchars-=tab:<=> |
a51ccadd0dca
patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
16592
diff
changeset
|
65 set listchars+=tab:<·> |
a51ccadd0dca
patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
16592
diff
changeset
|
66 set linebreak |
a51ccadd0dca
patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
16592
diff
changeset
|
67 let expected = [ |
a51ccadd0dca
patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
16592
diff
changeset
|
68 \ '<······>aa<····>$', |
a51ccadd0dca
patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
16592
diff
changeset
|
69 \ '..bb<··>--$', |
a51ccadd0dca
patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
16592
diff
changeset
|
70 \ '...cccc>-$', |
a51ccadd0dca
patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
16592
diff
changeset
|
71 \ 'dd........ee--<>$', |
a51ccadd0dca
patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
16592
diff
changeset
|
72 \ '-$' |
a51ccadd0dca
patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
16592
diff
changeset
|
73 \ ] |
a51ccadd0dca
patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
16592
diff
changeset
|
74 redraw! |
a51ccadd0dca
patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
16592
diff
changeset
|
75 for i in range(1, 5) |
a51ccadd0dca
patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
16592
diff
changeset
|
76 call cursor(i, 1) |
a51ccadd0dca
patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
16592
diff
changeset
|
77 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$'))) |
a51ccadd0dca
patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
16592
diff
changeset
|
78 endfor |
a51ccadd0dca
patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
16592
diff
changeset
|
79 set nolinebreak |
a51ccadd0dca
patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
16592
diff
changeset
|
80 set listchars-=tab:<·> |
a51ccadd0dca
patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
16592
diff
changeset
|
81 set listchars+=tab:<=> |
a51ccadd0dca
patch 8.1.1868: multi-byte chars in 'listchars' fail with 'linebreak' set
Bram Moolenaar <Bram@vim.org>
parents:
16592
diff
changeset
|
82 |
15502
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
83 set listchars-=trail:- |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
84 let expected = [ |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
85 \ '<======>aa<====>$', |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
86 \ '..bb<==>..$', |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
87 \ '...cccc>.$', |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
88 \ 'dd........ee..<>$', |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
89 \ '.$' |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
90 \ ] |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
91 redraw! |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
92 for i in range(1, 5) |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
93 call cursor(i, 1) |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
94 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$'))) |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
95 endfor |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
96 |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
97 set listchars-=tab:<=> |
bc17a9d37810
patch 8.1.0759: showing two characters for tab is limited
Bram Moolenaar <Bram@vim.org>
parents:
12851
diff
changeset
|
98 set listchars+=tab:>- |
12851
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
99 set listchars+=trail:< |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
100 set nolist |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
101 normal ggdG |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
102 call append(0, [ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
103 \ ' fff ', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
104 \ ' gg ', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
105 \ ' h ', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
106 \ 'iii ', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
107 \ ]) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
108 let l = split(execute("%list"), "\n") |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
109 call assert_equal([ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
110 \ '..fff>--<<$', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
111 \ '>-------gg>-----$', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
112 \ '.....h>-$', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
113 \ 'iii<<<<><<$', '$'], l) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
114 |
23825
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
115 " Test lead and trail |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
116 normal ggdG |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
117 set listchars& |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
118 set listchars+=lead:>,trail:<,space:x |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
119 set list |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
120 |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
121 call append(0, [ |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
122 \ ' ffff ', |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
123 \ ' gg', |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
124 \ 'h ', |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
125 \ ' ', |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
126 \ ' 0 0 ', |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
127 \ ]) |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
128 |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
129 let expected = [ |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
130 \ '>>>>ffff<<<<$', |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
131 \ '>>>>>>>>>>gg$', |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
132 \ 'h<<<<<<<<<<<$', |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
133 \ '<<<<<<<<<<<<$', |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
134 \ '>>>>0xx0<<<<$', |
29090
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
135 \ '$' |
23825
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
136 \ ] |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
137 redraw! |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
138 for i in range(1, 5) |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
139 call cursor(i, 1) |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
140 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$'))) |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
141 endfor |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
142 |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
143 call assert_equal(expected, split(execute("%list"), "\n")) |
15715
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
144 |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
145 " Test multispace |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
146 normal ggdG |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
147 set listchars& |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
148 set listchars+=multispace:yYzZ |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
149 set list |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
150 |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
151 call append(0, [ |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
152 \ ' ffff ', |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
153 \ ' i i gg', |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
154 \ ' h ', |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
155 \ ' j ', |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
156 \ ' 0 0 ', |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
157 \ ]) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
158 |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
159 let expected = [ |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
160 \ 'yYzZffffyYzZ$', |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
161 \ 'yYi iyYzZygg$', |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
162 \ ' hyYzZyYzZyY$', |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
163 \ 'yYzZyYzZyYj $', |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
164 \ 'yYzZ0yY0yYzZ$', |
29090
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
165 \ '$' |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
166 \ ] |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
167 redraw! |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
168 for i in range(1, 5) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
169 call cursor(i, 1) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
170 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$'))) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
171 endfor |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
172 |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
173 call assert_equal(expected, split(execute("%list"), "\n")) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
174 |
29090
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
175 " Test leadmultispace + multispace |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
176 normal ggdG |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
177 set listchars=eol:$,multispace:yYzZ,nbsp:S |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
178 set listchars+=leadmultispace:.-+* |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
179 set list |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
180 |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
181 call append(0, [ |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
182 \ ' ffff ', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
183 \ ' i i gg', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
184 \ ' h ', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
185 \ ' j ', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
186 \ ' 0 0 ', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
187 \ ]) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
188 |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
189 let expected = [ |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
190 \ '.-+*ffffyYzZ$', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
191 \ '.-i iSyYzZgg$', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
192 \ ' hyYzZyYzZyY$', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
193 \ '.-+*.-+*.-j $', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
194 \ '.-+*0yY0yYzZ$', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
195 \ '$' |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
196 \ ] |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
197 redraw! |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
198 call assert_equal('eol:$,multispace:yYzZ,nbsp:S,leadmultispace:.-+*', &listchars) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
199 for i in range(1, 5) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
200 call cursor(i, 1) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
201 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$'))) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
202 endfor |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
203 |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
204 call assert_equal(expected, split(execute("%list"), "\n")) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
205 |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
206 " Test leadmultispace without multispace |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
207 normal ggdG |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
208 set listchars-=multispace:yYzZ |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
209 set listchars+=space:+,trail:>,eol:$ |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
210 set list |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
211 |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
212 call append(0, [ |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
213 \ ' ffff ', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
214 \ ' i i gg', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
215 \ ' h ', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
216 \ ' j ', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
217 \ ' 0 0 ', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
218 \ ]) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
219 |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
220 let expected = [ |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
221 \ '.-+*ffff>>>>$', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
222 \ '.-i+i+++++gg$', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
223 \ '+h>>>>>>>>>>$', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
224 \ '.-+*.-+*.-j>$', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
225 \ '.-+*0++0>>>>$', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
226 \ '$', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
227 \ ] |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
228 |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
229 redraw! |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
230 call assert_equal('eol:$,nbsp:S,leadmultispace:.-+*,space:+,trail:>,eol:$', &listchars) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
231 for i in range(1, 5) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
232 call cursor(i, 1) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
233 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$'))) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
234 endfor |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
235 |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
236 call assert_equal(expected, split(execute("%list"), "\n")) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
237 |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
238 " Test leadmultispace only |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
239 normal ggdG |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
240 set listchars& |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
241 set listchars=leadmultispace:.-+* |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
242 set list |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
243 |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
244 call append(0, [ |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
245 \ ' ffff ', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
246 \ ' i i gg', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
247 \ ' h ', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
248 \ ' j ', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
249 \ ' 0 0 ', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
250 \ ]) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
251 |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
252 let expected = [ |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
253 \ '.-+*ffff ', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
254 \ '.-i i gg', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
255 \ ' h ', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
256 \ '.-+*.-+*.-j ', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
257 \ '.-+*0 0 ', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
258 \ ' ', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
259 \ ] |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
260 redraw! |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
261 call assert_equal('leadmultispace:.-+*', &listchars) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
262 for i in range(1, 5) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
263 call cursor(i, 1) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
264 call assert_equal([expected[i - 1]], ScreenLines(i, 12)) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
265 endfor |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
266 call assert_equal(expected, split(execute("%list"), "\n")) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
267 |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
268 " Test leadmultispace and lead and space |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
269 normal ggdG |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
270 set listchars& |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
271 set listchars+=lead:<,space:- |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
272 set listchars+=leadmultispace:.-+* |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
273 set list |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
274 |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
275 call append(0, [ |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
276 \ ' ffff ', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
277 \ ' i i gg', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
278 \ ' h ', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
279 \ ' j ', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
280 \ ' 0 0 ', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
281 \ ]) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
282 |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
283 let expected = [ |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
284 \ '.-+*ffff----$', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
285 \ '.-i-i-----gg$', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
286 \ '<h----------$', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
287 \ '.-+*.-+*.-j-$', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
288 \ '.-+*0--0----$', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
289 \ '$', |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
290 \ ] |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
291 redraw! |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
292 call assert_equal('eol:$,lead:<,space:-,leadmultispace:.-+*', &listchars) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
293 for i in range(1, 5) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
294 call cursor(i, 1) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
295 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$'))) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
296 endfor |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
297 call assert_equal(expected, split(execute("%list"), "\n")) |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
298 |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
299 " the last occurrence of 'multispace:' is used |
29090
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
300 set listchars& |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
301 set listchars+=multispace:yYzZ |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
302 set listchars+=space:x,multispace:XyY |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
303 |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
304 let expected = [ |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
305 \ 'XyYXffffXyYX$', |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
306 \ 'XyixiXyYXygg$', |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
307 \ 'xhXyYXyYXyYX$', |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
308 \ 'XyYXyYXyYXjx$', |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
309 \ 'XyYX0Xy0XyYX$', |
29090
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
310 \ '$' |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
311 \ ] |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
312 redraw! |
29090
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
313 call assert_equal('eol:$,multispace:yYzZ,space:x,multispace:XyY', &listchars) |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
314 for i in range(1, 5) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
315 call cursor(i, 1) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
316 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$'))) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
317 endfor |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
318 |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
319 call assert_equal(expected, split(execute("%list"), "\n")) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
320 |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
321 set listchars+=lead:>,trail:< |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
322 |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
323 let expected = [ |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
324 \ '>>>>ffff<<<<$', |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
325 \ '>>ixiXyYXygg$', |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
326 \ '>h<<<<<<<<<<$', |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
327 \ '>>>>>>>>>>j<$', |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
328 \ '>>>>0Xy0<<<<$', |
29090
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
329 \ '$' |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
330 \ ] |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
331 redraw! |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
332 for i in range(1, 5) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
333 call cursor(i, 1) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
334 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$'))) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
335 endfor |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
336 |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
337 call assert_equal(expected, split(execute("%list"), "\n")) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
338 |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
339 " removing 'multispace:' |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
340 set listchars-=multispace:XyY |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
341 set listchars-=multispace:yYzZ |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
342 |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
343 let expected = [ |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
344 \ '>>>>ffff<<<<$', |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
345 \ '>>ixixxxxxgg$', |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
346 \ '>h<<<<<<<<<<$', |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
347 \ '>>>>>>>>>>j<$', |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
348 \ '>>>>0xx0<<<<$', |
29090
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
349 \ '$' |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
350 \ ] |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
351 redraw! |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
352 for i in range(1, 5) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
353 call cursor(i, 1) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
354 call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$'))) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
355 endfor |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
356 |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
357 call assert_equal(expected, split(execute("%list"), "\n")) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
358 |
15715
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
359 " test nbsp |
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
360 normal ggdG |
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
361 set listchars=nbsp:X,trail:Y |
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
362 set list |
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
363 " Non-breaking space |
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
364 let nbsp = nr2char(0xa0) |
24198
c784e176334c
patch 8.2.2640: screenstring() returns non-existing composing characters
Bram Moolenaar <Bram@vim.org>
parents:
23956
diff
changeset
|
365 call append(0, [ ">" .. nbsp .. "<" ]) |
15715
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
366 |
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
367 let expected = '>X< ' |
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
368 |
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
369 redraw! |
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
370 call cursor(1, 1) |
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
371 call assert_equal([expected], ScreenLines(1, virtcol('$'))) |
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
372 |
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
373 set listchars=nbsp:X |
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
374 redraw! |
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
375 call cursor(1, 1) |
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
376 call assert_equal([expected], ScreenLines(1, virtcol('$'))) |
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
377 |
16592
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
378 " test extends |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
379 normal ggdG |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
380 set listchars=extends:Z |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
381 set nowrap |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
382 set nolist |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
383 call append(0, [ repeat('A', &columns + 1) ]) |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
384 |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
385 let expected = repeat('A', &columns) |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
386 |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
387 redraw! |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
388 call cursor(1, 1) |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
389 call assert_equal([expected], ScreenLines(1, &columns)) |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
390 |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
391 set list |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
392 let expected = expected[:-2] . 'Z' |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
393 redraw! |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
394 call cursor(1, 1) |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
395 call assert_equal([expected], ScreenLines(1, &columns)) |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
396 |
12851
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
397 enew! |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
398 set listchars& ff& |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
399 endfunc |
16146
aaa6e9a43a60
patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents:
15715
diff
changeset
|
400 |
16211
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
401 " Test that unicode listchars characters get properly inserted |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
402 func Test_listchars_unicode() |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
403 enew! |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
404 let oldencoding=&encoding |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
405 set encoding=utf-8 |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
406 set ff=unix |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
407 |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
408 set listchars=eol:⇔,space:␣,multispace:≡≢≣,nbsp:≠,tab:←↔→ |
16211
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
409 set list |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
410 |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
411 let nbsp = nr2char(0xa0) |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
412 call append(0, [" a\tb c" .. nbsp .. "d "]) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
413 let expected = ['≡≢≣≡≢≣≡≢a←↔↔↔↔↔→b␣c≠d≡≢⇔'] |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
414 redraw! |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
415 call cursor(1, 1) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
416 call assert_equal(expected, ScreenLines(1, virtcol('$'))) |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
417 |
25978
40b17deb294f
patch 8.2.3522: cannot use x and u when setting 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
25778
diff
changeset
|
418 set listchars=eol:\\u21d4,space:\\u2423,multispace:≡\\u2262\\U00002263,nbsp:\\U00002260,tab:←↔\\u2192 |
40b17deb294f
patch 8.2.3522: cannot use x and u when setting 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
25778
diff
changeset
|
419 redraw! |
40b17deb294f
patch 8.2.3522: cannot use x and u when setting 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
25778
diff
changeset
|
420 call assert_equal(expected, ScreenLines(1, virtcol('$'))) |
40b17deb294f
patch 8.2.3522: cannot use x and u when setting 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
25778
diff
changeset
|
421 |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
422 set listchars+=lead:⇨,trail:⇦ |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
423 let expected = ['⇨⇨⇨⇨⇨⇨⇨⇨a←↔↔↔↔↔→b␣c≠d⇦⇦⇔'] |
16211
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
424 redraw! |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
425 call cursor(1, 1) |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
426 call assert_equal(expected, ScreenLines(1, virtcol('$'))) |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
427 |
16211
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
428 let &encoding=oldencoding |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
429 enew! |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
430 set listchars& ff& |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
431 endfunction |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
432 |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
433 func Test_listchars_invalid() |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
434 enew! |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
435 set ff=unix |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
436 |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
437 set listchars& |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
438 set list |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
439 set ambiwidth=double |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
440 |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
441 " No colon |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
442 call assert_fails('set listchars=x', 'E474:') |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
443 call assert_fails('set listchars=x', 'E474:') |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
444 call assert_fails('set listchars=multispace', 'E474:') |
29090
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
445 call assert_fails('set listchars=leadmultispace', 'E474:') |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
446 |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
447 " Too short |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
448 call assert_fails('set listchars=space:', 'E474:') |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
449 call assert_fails('set listchars=tab:x', 'E474:') |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
450 call assert_fails('set listchars=multispace:', 'E474:') |
29090
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
451 call assert_fails('set listchars=leadmultispace:', 'E474:') |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
452 |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
453 " One occurrence too short |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
454 call assert_fails('set listchars=space:,space:x', 'E474:') |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
455 call assert_fails('set listchars=space:x,space:', 'E474:') |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
456 call assert_fails('set listchars=tab:x,tab:xx', 'E474:') |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
457 call assert_fails('set listchars=tab:xx,tab:x', 'E474:') |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
458 call assert_fails('set listchars=multispace:,multispace:x', 'E474:') |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
459 call assert_fails('set listchars=multispace:x,multispace:', 'E474:') |
29090
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
460 call assert_fails('set listchars=leadmultispace:,leadmultispace:x', 'E474:') |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
461 call assert_fails('set listchars=leadmultispace:x,leadmultispace:', 'E474:') |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
462 |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
463 " Too long |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
464 call assert_fails('set listchars=space:xx', 'E474:') |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
465 call assert_fails('set listchars=tab:xxxx', 'E474:') |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
466 |
26634
c75f70257cf5
patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents:
26077
diff
changeset
|
467 " Has double-width character |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
468 call assert_fails('set listchars=space:·', 'E474:') |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
469 call assert_fails('set listchars=tab:·x', 'E474:') |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
470 call assert_fails('set listchars=tab:x·', 'E474:') |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
471 call assert_fails('set listchars=tab:xx·', 'E474:') |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
472 call assert_fails('set listchars=multispace:·', 'E474:') |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
473 call assert_fails('set listchars=multispace:xxx·', 'E474:') |
29090
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
474 call assert_fails('set listchars=leadmultispace:·', 'E474:') |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
475 call assert_fails('set listchars=leadmultispace:xxx·', 'E474:') |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
476 |
26634
c75f70257cf5
patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents:
26077
diff
changeset
|
477 " Has control character |
c75f70257cf5
patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents:
26077
diff
changeset
|
478 call assert_fails("set listchars=space:\x01", 'E474:') |
c75f70257cf5
patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents:
26077
diff
changeset
|
479 call assert_fails("set listchars=tab:\x01x", 'E474:') |
c75f70257cf5
patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents:
26077
diff
changeset
|
480 call assert_fails("set listchars=tab:x\x01", 'E474:') |
c75f70257cf5
patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents:
26077
diff
changeset
|
481 call assert_fails("set listchars=tab:xx\x01", 'E474:') |
c75f70257cf5
patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents:
26077
diff
changeset
|
482 call assert_fails("set listchars=multispace:\x01", 'E474:') |
c75f70257cf5
patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents:
26077
diff
changeset
|
483 call assert_fails("set listchars=multispace:xxx\x01", 'E474:') |
c75f70257cf5
patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents:
26077
diff
changeset
|
484 call assert_fails('set listchars=space:\\x01', 'E474:') |
c75f70257cf5
patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents:
26077
diff
changeset
|
485 call assert_fails('set listchars=tab:\\x01x', 'E474:') |
c75f70257cf5
patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents:
26077
diff
changeset
|
486 call assert_fails('set listchars=tab:x\\x01', 'E474:') |
c75f70257cf5
patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents:
26077
diff
changeset
|
487 call assert_fails('set listchars=tab:xx\\x01', 'E474:') |
c75f70257cf5
patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents:
26077
diff
changeset
|
488 call assert_fails('set listchars=multispace:\\x01', 'E474:') |
c75f70257cf5
patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents:
26077
diff
changeset
|
489 call assert_fails('set listchars=multispace:xxx\\x01', 'E474:') |
29090
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
490 call assert_fails("set listchars=leadmultispace:\x01", 'E474:') |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
491 call assert_fails('set listchars=leadmultispace:\\x01', 'E474:') |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
492 call assert_fails("set listchars=leadmultispace:xxx\x01", 'E474:') |
9b292596a332
patch 8.2.5066: timer_create is not available on every Mac system
Bram Moolenaar <Bram@vim.org>
parents:
26634
diff
changeset
|
493 call assert_fails('set listchars=leadmultispace:xxx\\x01', 'E474:') |
26634
c75f70257cf5
patch 8.2.3846: no error when using control character for 'lcs' or 'fcs'
Bram Moolenaar <Bram@vim.org>
parents:
26077
diff
changeset
|
494 |
25778
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
495 enew! |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
496 set ambiwidth& listchars& ff& |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
497 endfunction |
373278f5bd51
patch 8.2.3424: a sequence of spaces is hard to see in list mode
Bram Moolenaar <Bram@vim.org>
parents:
25172
diff
changeset
|
498 |
16211
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
499 " Tests that space characters following composing character won't get replaced |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
500 " by listchars. |
16146
aaa6e9a43a60
patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents:
15715
diff
changeset
|
501 func Test_listchars_composing() |
aaa6e9a43a60
patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents:
15715
diff
changeset
|
502 enew! |
aaa6e9a43a60
patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents:
15715
diff
changeset
|
503 let oldencoding=&encoding |
aaa6e9a43a60
patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents:
15715
diff
changeset
|
504 set encoding=utf-8 |
aaa6e9a43a60
patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents:
15715
diff
changeset
|
505 set ff=unix |
aaa6e9a43a60
patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents:
15715
diff
changeset
|
506 set list |
aaa6e9a43a60
patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents:
15715
diff
changeset
|
507 |
16211
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
508 set listchars=eol:$,space:_,nbsp:= |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
509 |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
510 let nbsp1 = nr2char(0xa0) |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
511 let nbsp2 = nr2char(0x202f) |
16146
aaa6e9a43a60
patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents:
15715
diff
changeset
|
512 call append(0, [ |
24198
c784e176334c
patch 8.2.2640: screenstring() returns non-existing composing characters
Bram Moolenaar <Bram@vim.org>
parents:
23956
diff
changeset
|
513 \ " \u3099\t \u309A" .. nbsp1 .. nbsp1 .. "\u0302" .. nbsp2 .. nbsp2 .. "\u0302", |
16146
aaa6e9a43a60
patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents:
15715
diff
changeset
|
514 \ ]) |
aaa6e9a43a60
patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents:
15715
diff
changeset
|
515 let expected = [ |
24198
c784e176334c
patch 8.2.2640: screenstring() returns non-existing composing characters
Bram Moolenaar <Bram@vim.org>
parents:
23956
diff
changeset
|
516 \ "_ \u3099^I \u309A=" .. nbsp1 .. "\u0302=" .. nbsp2 .. "\u0302$" |
16146
aaa6e9a43a60
patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents:
15715
diff
changeset
|
517 \ ] |
aaa6e9a43a60
patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents:
15715
diff
changeset
|
518 redraw! |
aaa6e9a43a60
patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents:
15715
diff
changeset
|
519 call cursor(1, 1) |
16211
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
520 call assert_equal(expected, ScreenLines(1, virtcol('$'))) |
16146
aaa6e9a43a60
patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents:
15715
diff
changeset
|
521 let &encoding=oldencoding |
16211
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
522 enew! |
16146
aaa6e9a43a60
patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents:
15715
diff
changeset
|
523 set listchars& ff& |
aaa6e9a43a60
patch 8.1.1078: when 'listchars' is set a composing char on a space is wrong
Bram Moolenaar <Bram@vim.org>
parents:
15715
diff
changeset
|
524 endfunction |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
525 |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
526 " Check for the value of the 'listchars' option |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
527 func s:CheckListCharsValue(expected) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
528 call assert_equal(a:expected, &listchars) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
529 call assert_equal(a:expected, getwinvar(0, '&listchars')) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
530 endfunc |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
531 |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
532 " Test for using a window local value for 'listchars' |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
533 func Test_listchars_window_local() |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
534 %bw! |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
535 set list listchars& |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
536 new |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
537 " set a local value for 'listchars' |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
538 setlocal listchars=tab:+-,eol:# |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
539 call s:CheckListCharsValue('tab:+-,eol:#') |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
540 " When local value is reset, global value should be used |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
541 setlocal listchars= |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
542 call s:CheckListCharsValue('eol:$') |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
543 " Use 'setlocal <' to copy global value |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
544 setlocal listchars=space:.,extends:> |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
545 setlocal listchars< |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
546 call s:CheckListCharsValue('eol:$') |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
547 " Use 'set <' to copy global value |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
548 setlocal listchars=space:.,extends:> |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
549 set listchars< |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
550 call s:CheckListCharsValue('eol:$') |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
551 " Changing global setting should not change the local setting |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
552 setlocal listchars=space:.,extends:> |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
553 setglobal listchars=tab:+-,eol:# |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
554 call s:CheckListCharsValue('space:.,extends:>') |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
555 " when split opening a new window, local value should be copied |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
556 split |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
557 call s:CheckListCharsValue('space:.,extends:>') |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
558 " clearing local value in one window should not change the other window |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
559 set listchars& |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
560 call s:CheckListCharsValue('eol:$') |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
561 close |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
562 call s:CheckListCharsValue('space:.,extends:>') |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
563 |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
564 " use different values for 'listchars' items in two different windows |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
565 call setline(1, ["\t one two "]) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
566 setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:# |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
567 split |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
568 setlocal listchars=tab:[.],lead:#,space:_,trail:.,eol:& |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
569 split |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
570 set listchars=tab:+-+,lead:^,space:>,trail:<,eol:% |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
571 call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$'))) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
572 close |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
573 call assert_equal(['[......]##one__two..&'], ScreenLines(1, virtcol('$'))) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
574 close |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
575 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$'))) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
576 " changing the global setting should not change the local value |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
577 setglobal listchars=tab:[.],lead:#,space:_,trail:.,eol:& |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
578 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$'))) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
579 set listchars< |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
580 call assert_equal(['[......]##one__two..&'], ScreenLines(1, virtcol('$'))) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
581 |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
582 " Using setglobal in a window with local setting should not affect the |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
583 " window. But should impact other windows using the global setting. |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
584 enew! | only |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
585 call setline(1, ["\t one two "]) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
586 set listchars=tab:[.],lead:#,space:_,trail:.,eol:& |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
587 split |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
588 setlocal listchars=tab:+-+,lead:^,space:>,trail:<,eol:% |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
589 split |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
590 setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:# |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
591 setglobal listchars=tab:{.},lead:-,space:=,trail:#,eol:$ |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
592 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$'))) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
593 close |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
594 call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$'))) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
595 close |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
596 call assert_equal(['{......}--one==two##$'], ScreenLines(1, virtcol('$'))) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
597 |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
598 " Setting the global setting to the default value should not impact a window |
26077
ad90d7eee236
patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents:
25978
diff
changeset
|
599 " using a local setting. |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
600 split |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
601 setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:# |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
602 setglobal listchars&vim |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
603 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$'))) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
604 close |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
605 call assert_equal(['^I one two $'], ScreenLines(1, virtcol('$'))) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
606 |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
607 " Setting the local setting to the default value should not impact a window |
26077
ad90d7eee236
patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents:
25978
diff
changeset
|
608 " using a global setting. |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
609 set listchars=tab:{.},lead:-,space:=,trail:#,eol:$ |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
610 split |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
611 setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:# |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
612 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$'))) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
613 setlocal listchars&vim |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
614 call assert_equal(['^I one two $'], ScreenLines(1, virtcol('$'))) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
615 close |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
616 call assert_equal(['{......}--one==two##$'], ScreenLines(1, virtcol('$'))) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
617 |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
618 " Using set in a window with a local setting should change it to use the |
26077
ad90d7eee236
patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents:
25978
diff
changeset
|
619 " global setting and also impact other windows using the global setting. |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
620 split |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
621 setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:# |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
622 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$'))) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
623 set listchars=tab:+-+,lead:^,space:>,trail:<,eol:% |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
624 call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$'))) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
625 close |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
626 call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$'))) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
627 |
23956
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
628 " Setting invalid value for a local setting should not impact the local and |
26077
ad90d7eee236
patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents:
25978
diff
changeset
|
629 " global settings. |
23956
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
630 split |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
631 setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:# |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
632 let cmd = 'setlocal listchars=tab:{.},lead:-,space:=,trail:#,eol:$,x' |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
633 call assert_fails(cmd, 'E474:') |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
634 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$'))) |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
635 close |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
636 call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$'))) |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
637 |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
638 " Setting invalid value for a global setting should not impact the local and |
26077
ad90d7eee236
patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents:
25978
diff
changeset
|
639 " global settings. |
23956
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
640 split |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
641 setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:# |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
642 let cmd = 'setglobal listchars=tab:{.},lead:-,space:=,trail:#,eol:$,x' |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
643 call assert_fails(cmd, 'E474:') |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
644 call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$'))) |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
645 close |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
646 call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$'))) |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
647 |
26077
ad90d7eee236
patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents:
25978
diff
changeset
|
648 " Closing window with local lcs-multispace should not cause a memory leak. |
ad90d7eee236
patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents:
25978
diff
changeset
|
649 setlocal listchars=multispace:---+ |
ad90d7eee236
patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents:
25978
diff
changeset
|
650 split |
ad90d7eee236
patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents:
25978
diff
changeset
|
651 call s:CheckListCharsValue('multispace:---+') |
ad90d7eee236
patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents:
25978
diff
changeset
|
652 close |
ad90d7eee236
patch 8.2.3572: memory leak when closing window and using "multispace"
Bram Moolenaar <Bram@vim.org>
parents:
25978
diff
changeset
|
653 |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
654 %bw! |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
655 set list& listchars& |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
656 endfunc |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
657 |
25170
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
658 func Test_listchars_foldcolumn() |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
659 CheckScreendump |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
660 |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
661 let lines =<< trim END |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
662 call setline(1, ['aaa', '', 'a', 'aaaaaa']) |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
663 vsplit |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
664 vsplit |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
665 windo set signcolumn=yes foldcolumn=1 winminwidth=0 nowrap list listchars=extends:>,precedes:< |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
666 END |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
667 call writefile(lines, 'XTest_listchars') |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
668 |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
669 let buf = RunVimInTerminal('-S XTest_listchars', {'rows': 10, 'cols': 60}) |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
670 |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
671 call term_sendkeys(buf, "13\<C-W>>") |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
672 call VerifyScreenDump(buf, 'Test_listchars_01', {}) |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
673 call term_sendkeys(buf, "\<C-W>>") |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
674 call VerifyScreenDump(buf, 'Test_listchars_02', {}) |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
675 call term_sendkeys(buf, "\<C-W>>") |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
676 call VerifyScreenDump(buf, 'Test_listchars_03', {}) |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
677 call term_sendkeys(buf, "\<C-W>>") |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
678 call VerifyScreenDump(buf, 'Test_listchars_04', {}) |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
679 call term_sendkeys(buf, "\<C-W>>") |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
680 call VerifyScreenDump(buf, 'Test_listchars_05', {}) |
25172
406ab8d0bc0f
patch 8.2.3122: with 'nowrap' cursor position is unexected in narrow window
Bram Moolenaar <Bram@vim.org>
parents:
25170
diff
changeset
|
681 call term_sendkeys(buf, "\<C-W>h") |
406ab8d0bc0f
patch 8.2.3122: with 'nowrap' cursor position is unexected in narrow window
Bram Moolenaar <Bram@vim.org>
parents:
25170
diff
changeset
|
682 call term_sendkeys(buf, ":set nowrap foldcolumn=4\<CR>") |
406ab8d0bc0f
patch 8.2.3122: with 'nowrap' cursor position is unexected in narrow window
Bram Moolenaar <Bram@vim.org>
parents:
25170
diff
changeset
|
683 call term_sendkeys(buf, "15\<C-W><") |
406ab8d0bc0f
patch 8.2.3122: with 'nowrap' cursor position is unexected in narrow window
Bram Moolenaar <Bram@vim.org>
parents:
25170
diff
changeset
|
684 call VerifyScreenDump(buf, 'Test_listchars_06', {}) |
406ab8d0bc0f
patch 8.2.3122: with 'nowrap' cursor position is unexected in narrow window
Bram Moolenaar <Bram@vim.org>
parents:
25170
diff
changeset
|
685 call term_sendkeys(buf, "4\<C-W><") |
406ab8d0bc0f
patch 8.2.3122: with 'nowrap' cursor position is unexected in narrow window
Bram Moolenaar <Bram@vim.org>
parents:
25170
diff
changeset
|
686 call VerifyScreenDump(buf, 'Test_listchars_07', {}) |
25170
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
687 |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
688 " clean up |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
689 call StopVimInTerminal(buf) |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
690 call delete('XTest_listchars') |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
691 endfunc |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
692 |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
693 |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
694 " vim: shiftwidth=2 sts=2 expandtab |