Mercurial > vim
annotate src/testdir/test_listchars.vim @ 25172:406ab8d0bc0f v8.2.3122
patch 8.2.3122: with 'nowrap' cursor position is unexected in narrow window
Commit: https://github.com/vim/vim/commit/30441bb3d5fa73f888b09684db3f54ff5ab48dbc
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jul 8 13:19:31 2021 +0200
patch 8.2.3122: with 'nowrap' cursor position is unexected in narrow window
Problem: With 'nowrap' cursor position is unexected in narrow window.
(Leonid V. Fedorenchik)
Solution: Put cursor on the last non-empty line. (closes #8525)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 08 Jul 2021 13:30:04 +0200 |
parents | ac54d215fbec |
children | 373278f5bd51 |
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<<<<$', |
0bd44e94dd14
patch 8.2.2454: leading space can not be made visible
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
135 \ '$' |
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 |
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
145 " 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
|
146 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
|
147 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
|
148 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
|
149 " 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
|
150 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
|
151 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
|
152 |
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
153 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
|
154 |
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
155 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
|
156 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
|
157 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
|
158 |
52930462eec4
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Bram Moolenaar <Bram@vim.org>
parents:
15502
diff
changeset
|
159 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
|
160 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
|
161 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
|
162 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
|
163 |
16592
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
164 " 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
|
165 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
|
166 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
|
167 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
|
168 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
|
169 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
|
170 |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
171 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
|
172 |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
173 redraw! |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
174 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
|
175 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
|
176 |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
177 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
|
178 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
|
179 redraw! |
80bb4ce2a281
patch 8.1.1299: "extends" from 'listchars' is used when 'list' is off
Bram Moolenaar <Bram@vim.org>
parents:
16211
diff
changeset
|
180 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
|
181 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
|
182 |
12851
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
183 enew! |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
184 set listchars& ff& |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
185 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
|
186 |
16211
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
187 " 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
|
188 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
|
189 enew! |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
190 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
|
191 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
|
192 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
|
193 |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
194 set listchars=eol:⇔,space:␣,nbsp:≠,tab:←↔→ |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
195 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
|
196 |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
197 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
|
198 call append(0, ["a\tb c" .. nbsp .. "d"]) |
c784e176334c
patch 8.2.2640: screenstring() returns non-existing composing characters
Bram Moolenaar <Bram@vim.org>
parents:
23956
diff
changeset
|
199 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
|
200 redraw! |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
201 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
|
202 call assert_equal(expected, ScreenLines(1, virtcol('$'))) |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
203 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
|
204 enew! |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
205 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
|
206 endfunction |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
207 |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
208 " 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
|
209 " 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
|
210 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
|
211 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
|
212 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
|
213 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
|
214 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
|
215 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
|
216 |
16211
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
217 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
|
218 |
5fb0f15fafea
patch 8.1.1110: composing chars on space wrong when 'listchars' is set
Bram Moolenaar <Bram@vim.org>
parents:
16148
diff
changeset
|
219 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
|
220 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
|
221 call append(0, [ |
24198
c784e176334c
patch 8.2.2640: screenstring() returns non-existing composing characters
Bram Moolenaar <Bram@vim.org>
parents:
23956
diff
changeset
|
222 \ " \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
|
223 \ ]) |
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
|
224 let expected = [ |
24198
c784e176334c
patch 8.2.2640: screenstring() returns non-existing composing characters
Bram Moolenaar <Bram@vim.org>
parents:
23956
diff
changeset
|
225 \ "_ \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
|
226 \ ] |
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
|
227 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
|
228 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
|
229 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
|
230 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
|
231 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
|
232 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
|
233 endfunction |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
234 |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
235 " 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
|
236 func s:CheckListCharsValue(expected) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
237 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
|
238 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
|
239 endfunc |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
240 |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
241 " 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
|
242 func Test_listchars_window_local() |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
243 %bw! |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
244 set list listchars& |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
245 new |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
246 " 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
|
247 setlocal listchars=tab:+-,eol:# |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
248 call s:CheckListCharsValue('tab:+-,eol:#') |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
249 " 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
|
250 setlocal listchars= |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
251 call s:CheckListCharsValue('eol:$') |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
252 " 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
|
253 setlocal listchars=space:.,extends:> |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
254 setlocal listchars< |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
255 call s:CheckListCharsValue('eol:$') |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
256 " 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
|
257 setlocal listchars=space:.,extends:> |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
258 set listchars< |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
259 call s:CheckListCharsValue('eol:$') |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
260 " 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
|
261 setlocal listchars=space:.,extends:> |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
262 setglobal listchars=tab:+-,eol:# |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
263 call s:CheckListCharsValue('space:.,extends:>') |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
264 " 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
|
265 split |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
266 call s:CheckListCharsValue('space:.,extends:>') |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
267 " 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
|
268 set listchars& |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
269 call s:CheckListCharsValue('eol:$') |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
270 close |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
271 call s:CheckListCharsValue('space:.,extends:>') |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
272 |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
273 " 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
|
274 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
|
275 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
|
276 split |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
277 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
|
278 split |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
279 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
|
280 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
|
281 close |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
282 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
|
283 close |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
284 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
|
285 " 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
|
286 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
|
287 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
|
288 set listchars< |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
289 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
|
290 |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
291 " 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
|
292 " 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
|
293 enew! | only |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
294 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
|
295 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
|
296 split |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
297 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
|
298 split |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
299 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
|
300 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
|
301 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
|
302 close |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
303 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
|
304 close |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
305 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
|
306 |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
307 " Setting the global setting to the default value should not impact a window |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
308 " using a local setting |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
309 split |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
310 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
|
311 setglobal listchars&vim |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
312 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
|
313 close |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
314 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
|
315 |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
316 " Setting the local setting to the default value should not impact a window |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
317 " using a global setting |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
318 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
|
319 split |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
320 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
|
321 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
|
322 setlocal listchars&vim |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
323 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
|
324 close |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
325 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
|
326 |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
327 " Using set in a window with a local setting should change it to use the |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
328 " global setting and also 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
|
329 split |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
330 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
|
331 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
|
332 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
|
333 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
|
334 close |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
335 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
|
336 |
23956
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
337 " Setting invalid value for a local setting should not impact the local and |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
338 " global settings |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
339 split |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
340 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
|
341 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
|
342 call assert_fails(cmd, 'E474:') |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
343 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
|
344 close |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
345 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
|
346 |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
347 " Setting invalid value for a global setting should not impact the local and |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
348 " global settings |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
349 split |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
350 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
|
351 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
|
352 call assert_fails(cmd, 'E474:') |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
353 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
|
354 close |
4d88e660ce32
patch 8.2.2520: missing tests for 'listchars'
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
355 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
|
356 |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
357 %bw! |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
358 set list& listchars& |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
359 endfunc |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23825
diff
changeset
|
360 |
25170
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
361 func Test_listchars_foldcolumn() |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
362 CheckScreendump |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
363 |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
364 let lines =<< trim END |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
365 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
|
366 vsplit |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
367 vsplit |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
368 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
|
369 END |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
370 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
|
371 |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
372 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
|
373 |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
374 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
|
375 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
|
376 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
|
377 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
|
378 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
|
379 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
|
380 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
|
381 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
|
382 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
|
383 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
|
384 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
|
385 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
|
386 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
|
387 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
|
388 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
|
389 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
|
390 |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
391 " clean up |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
392 call StopVimInTerminal(buf) |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
393 call delete('XTest_listchars') |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
394 endfunc |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
395 |
ac54d215fbec
patch 8.2.3121: 'listchars' "exceeds" character appears in foldcolumn
Bram Moolenaar <Bram@vim.org>
parents:
24198
diff
changeset
|
396 |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
397 " vim: shiftwidth=2 sts=2 expandtab |