Mercurial > vim
annotate src/testdir/test_statusline.vim @ 34639:ceee63c7f7aa v9.1.0205
patch 9.1.0205: Cannot use modifiers before :-Ntabmove
Commit: https://github.com/vim/vim/commit/076faac5378cf517baa8c331c57488d39efadec0
Author: zeertzjq <zeertzjq@outlook.com>
Date: Mon Mar 25 16:41:06 2024 +0100
patch 9.1.0205: Cannot use modifiers before :-Ntabmove
Problem: Cannot use modifiers before :-Ntabmove.
Solution: Check backwards from the command instead of checking from the
start of the command line. Slightly adjust docs to make them
more consistent (zeertzjq).
closes: #14289
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 25 Mar 2024 16:45:06 +0100 |
parents | b140246564f4 |
children |
rev | line source |
---|---|
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
1 " Test 'statusline' |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
2 " |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
3 " Not tested yet: |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
4 " %N |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
5 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
6 source view_util.vim |
18767
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
18746
diff
changeset
|
7 source check.vim |
19354
1d3b2ce65ae0
patch 8.2.0235: draw error when an empty group is removed from 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
8 source screendump.vim |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
9 |
29434
5da38c4ffe92
patch 9.0.0059: test file has wrong name
Bram Moolenaar <Bram@vim.org>
parents:
28811
diff
changeset
|
10 func SetUp() |
5da38c4ffe92
patch 9.0.0059: test file has wrong name
Bram Moolenaar <Bram@vim.org>
parents:
28811
diff
changeset
|
11 set laststatus=2 |
5da38c4ffe92
patch 9.0.0059: test file has wrong name
Bram Moolenaar <Bram@vim.org>
parents:
28811
diff
changeset
|
12 endfunc |
5da38c4ffe92
patch 9.0.0059: test file has wrong name
Bram Moolenaar <Bram@vim.org>
parents:
28811
diff
changeset
|
13 |
5da38c4ffe92
patch 9.0.0059: test file has wrong name
Bram Moolenaar <Bram@vim.org>
parents:
28811
diff
changeset
|
14 func TearDown() |
5da38c4ffe92
patch 9.0.0059: test file has wrong name
Bram Moolenaar <Bram@vim.org>
parents:
28811
diff
changeset
|
15 set laststatus& |
5da38c4ffe92
patch 9.0.0059: test file has wrong name
Bram Moolenaar <Bram@vim.org>
parents:
28811
diff
changeset
|
16 endfunc |
5da38c4ffe92
patch 9.0.0059: test file has wrong name
Bram Moolenaar <Bram@vim.org>
parents:
28811
diff
changeset
|
17 |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
18 func s:get_statusline() |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
19 return ScreenLines(&lines - 1, &columns)[0] |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
20 endfunc |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
21 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
22 func StatuslineWithCaughtError() |
8847
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 let s:func_in_statusline_called = 1 |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 try |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 call eval('unknown expression') |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 catch |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 endtry |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 return '' |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
29 endfunc |
8847
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
31 func StatuslineWithError() |
8847
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 let s:func_in_statusline_called = 1 |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 call eval('unknown expression') |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 return '' |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
35 endfunc |
8847
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
37 " Function used to display syntax group. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
38 func SyntaxItem() |
16740
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
39 call assert_equal(s:expected_curbuf, g:actual_curbuf) |
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
40 call assert_equal(s:expected_curwin, g:actual_curwin) |
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
41 return synIDattr(synID(line("."), col("."),1), "name") |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
42 endfunc |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
43 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
44 func Test_caught_error_in_statusline() |
8847
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
45 let s:func_in_statusline_called = 0 |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 let statusline = '%{StatuslineWithCaughtError()}' |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
47 let &statusline = statusline |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
48 redrawstatus |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
49 call assert_true(s:func_in_statusline_called) |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
50 call assert_equal(statusline, &statusline) |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
51 set statusline= |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
52 endfunc |
8847
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
53 |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
54 func Test_statusline_will_be_disabled_with_error() |
8847
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
55 let s:func_in_statusline_called = 0 |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
56 let statusline = '%{StatuslineWithError()}' |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
57 try |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
58 let &statusline = statusline |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
59 redrawstatus |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
60 catch |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
61 endtry |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
62 call assert_true(s:func_in_statusline_called) |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
63 call assert_equal('', &statusline) |
470ea7526cc6
commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
64 set statusline= |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
65 endfunc |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
66 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
67 func Test_statusline() |
18767
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
18746
diff
changeset
|
68 CheckFeature quickfix |
068337e86133
patch 8.1.2373: cannot build with +popupwin but without +quickfix
Bram Moolenaar <Bram@vim.org>
parents:
18746
diff
changeset
|
69 |
20984
fe06ee7d3511
patch 8.2.1043: %a item in 'statusline' not tested
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
70 " %a: Argument list ({current} of {max}) |
fe06ee7d3511
patch 8.2.1043: %a item in 'statusline' not tested
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
71 set statusline=%a |
fe06ee7d3511
patch 8.2.1043: %a item in 'statusline' not tested
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
72 call assert_match('^\s*$', s:get_statusline()) |
fe06ee7d3511
patch 8.2.1043: %a item in 'statusline' not tested
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
73 arglocal a1 a2 |
fe06ee7d3511
patch 8.2.1043: %a item in 'statusline' not tested
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
74 rewind |
fe06ee7d3511
patch 8.2.1043: %a item in 'statusline' not tested
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
75 call assert_match('^ (1 of 2)\s*$', s:get_statusline()) |
fe06ee7d3511
patch 8.2.1043: %a item in 'statusline' not tested
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
76 next |
fe06ee7d3511
patch 8.2.1043: %a item in 'statusline' not tested
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
77 call assert_match('^ (2 of 2)\s*$', s:get_statusline()) |
fe06ee7d3511
patch 8.2.1043: %a item in 'statusline' not tested
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
78 e Xstatusline |
fe06ee7d3511
patch 8.2.1043: %a item in 'statusline' not tested
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
79 call assert_match('^ ((2) of 2)\s*$', s:get_statusline()) |
fe06ee7d3511
patch 8.2.1043: %a item in 'statusline' not tested
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
80 |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
81 only |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
82 set splitbelow |
16332
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
83 call setline(1, range(1, 10000)) |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
84 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
85 " %b: Value of character under cursor. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
86 " %B: As above, in hexadecimal. |
16332
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
87 call cursor(9000, 1) |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
88 set statusline=%b,%B |
16332
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
89 call assert_match('^57,39\s*$', s:get_statusline()) |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
90 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
91 " %o: Byte number in file of byte under cursor, first byte is 1. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
92 " %O: As above, in hexadecimal. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
93 set statusline=%o,%O |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
94 set fileformat=dos |
16332
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
95 call assert_match('^52888,CE98\s*$', s:get_statusline()) |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
96 set fileformat=mac |
16332
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
97 call assert_match('^43889,AB71\s*$', s:get_statusline()) |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
98 set fileformat=unix |
16332
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
99 call assert_match('^43889,AB71\s*$', s:get_statusline()) |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
100 set fileformat& |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
101 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
102 " %f: Path to the file in the buffer, as typed or relative to current dir. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
103 set statusline=%f |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
104 call assert_match('^Xstatusline\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
105 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
106 " %F: Full path to the file in the buffer. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
107 set statusline=%F |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
108 call assert_match('/testdir/Xstatusline\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
109 |
21004
0650d220f742
patch 8.2.1053: insufficient testing for 'statusline' and 'tabline'
Bram Moolenaar <Bram@vim.org>
parents:
20984
diff
changeset
|
110 " Test for min and max width with %(. For some reason, if this test is moved |
0650d220f742
patch 8.2.1053: insufficient testing for 'statusline' and 'tabline'
Bram Moolenaar <Bram@vim.org>
parents:
20984
diff
changeset
|
111 " after the below test for the help buffer flag, then the code to truncate |
0650d220f742
patch 8.2.1053: insufficient testing for 'statusline' and 'tabline'
Bram Moolenaar <Bram@vim.org>
parents:
20984
diff
changeset
|
112 " the string is not executed. |
0650d220f742
patch 8.2.1053: insufficient testing for 'statusline' and 'tabline'
Bram Moolenaar <Bram@vim.org>
parents:
20984
diff
changeset
|
113 set statusline=%015(%f%) |
0650d220f742
patch 8.2.1053: insufficient testing for 'statusline' and 'tabline'
Bram Moolenaar <Bram@vim.org>
parents:
20984
diff
changeset
|
114 call assert_match('^ Xstatusline\s*$', s:get_statusline()) |
0650d220f742
patch 8.2.1053: insufficient testing for 'statusline' and 'tabline'
Bram Moolenaar <Bram@vim.org>
parents:
20984
diff
changeset
|
115 set statusline=%.6(%f%) |
0650d220f742
patch 8.2.1053: insufficient testing for 'statusline' and 'tabline'
Bram Moolenaar <Bram@vim.org>
parents:
20984
diff
changeset
|
116 call assert_match('^<sline\s*$', s:get_statusline()) |
0650d220f742
patch 8.2.1053: insufficient testing for 'statusline' and 'tabline'
Bram Moolenaar <Bram@vim.org>
parents:
20984
diff
changeset
|
117 set statusline=%14f |
0650d220f742
patch 8.2.1053: insufficient testing for 'statusline' and 'tabline'
Bram Moolenaar <Bram@vim.org>
parents:
20984
diff
changeset
|
118 call assert_match('^ Xstatusline\s*$', s:get_statusline()) |
0650d220f742
patch 8.2.1053: insufficient testing for 'statusline' and 'tabline'
Bram Moolenaar <Bram@vim.org>
parents:
20984
diff
changeset
|
119 set statusline=%.4L |
0650d220f742
patch 8.2.1053: insufficient testing for 'statusline' and 'tabline'
Bram Moolenaar <Bram@vim.org>
parents:
20984
diff
changeset
|
120 call assert_match('^10>3\s*$', s:get_statusline()) |
0650d220f742
patch 8.2.1053: insufficient testing for 'statusline' and 'tabline'
Bram Moolenaar <Bram@vim.org>
parents:
20984
diff
changeset
|
121 |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
122 " %h: Help buffer flag, text is "[help]". |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
123 " %H: Help buffer flag, text is ",HLP". |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
124 set statusline=%h,%H |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
125 call assert_match('^,\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
126 help |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
127 call assert_match('^\[Help\],HLP\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
128 helpclose |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
129 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
130 " %k: Value of "b:keymap_name" or 'keymap' |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
131 " when :lmap mappings are being used: <keymap>" |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
132 set statusline=%k |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
133 if has('keymap') |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
134 set keymap=esperanto |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
135 call assert_match('^<Eo>\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
136 set keymap& |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
137 else |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
138 call assert_match('^\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
139 endif |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
140 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
141 " %l: Line number. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
142 " %L: Number of line in buffer. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
143 " %c: Column number. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
144 set statusline=%l/%L,%c |
16332
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
145 call assert_match('^9000/10000,1\s*$', s:get_statusline()) |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
146 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
147 " %m: Modified flag, text is "[+]", "[-]" if 'modifiable' is off. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
148 " %M: Modified flag, text is ",+" or ",-". |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
149 set statusline=%m%M |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
150 call assert_match('^\[+\],+\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
151 set nomodifiable |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
152 call assert_match('^\[+-\],+-\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
153 write |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
154 call assert_match('^\[-\],-\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
155 set modifiable& |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
156 call assert_match('^\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
157 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
158 " %n: Buffer number. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
159 set statusline=%n |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
160 call assert_match('^'.bufnr('%').'\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
161 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
162 " %p: Percentage through file in lines as in CTRL-G. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
163 " %P: Percentage through file of displayed window. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
164 set statusline=%p,%P |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
165 0 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
166 call assert_match('^0,Top\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
167 norm G |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
168 call assert_match('^100,Bot\s*$', s:get_statusline()) |
16332
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
169 9000 |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
170 " Don't check the exact percentage as it depends on the window size |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
171 call assert_match('^90,\(Top\|Bot\|\d\+%\)\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
172 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
173 " %q: "[Quickfix List]", "[Location List]" or empty. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
174 set statusline=%q |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
175 call assert_match('^\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
176 copen |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
177 call assert_match('^\[Quickfix List\]\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
178 cclose |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
179 lexpr getline(1, 2) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
180 lopen |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
181 call assert_match('^\[Location List\]\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
182 lclose |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
183 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
184 " %r: Readonly flag, text is "[RO]". |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
185 " %R: Readonly flag, text is ",RO". |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
186 set statusline=%r,%R |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
187 call assert_match('^,\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
188 help |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
189 call assert_match('^\[RO\],RO\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
190 helpclose |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
191 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
192 " %t: File name (tail) of file in the buffer. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
193 set statusline=%t |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
194 call assert_match('^Xstatusline\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
195 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
196 " %v: Virtual column number. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
197 " %V: Virtual column number as -{num}. Not displayed if equal to 'c'. |
16332
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
198 call cursor(9000, 2) |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
199 set statusline=%v,%V |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
200 call assert_match('^2,\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
201 set virtualedit=all |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
202 norm 10| |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
203 call assert_match('^10,-10\s*$', s:get_statusline()) |
27124
8f1f4f6c87ad
patch 8.2.4091: virtcol is recomputed for statusline unnecessarily
Bram Moolenaar <Bram@vim.org>
parents:
25907
diff
changeset
|
204 set list |
8f1f4f6c87ad
patch 8.2.4091: virtcol is recomputed for statusline unnecessarily
Bram Moolenaar <Bram@vim.org>
parents:
25907
diff
changeset
|
205 call assert_match('^10,-10\s*$', s:get_statusline()) |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
206 set virtualedit& |
27124
8f1f4f6c87ad
patch 8.2.4091: virtcol is recomputed for statusline unnecessarily
Bram Moolenaar <Bram@vim.org>
parents:
25907
diff
changeset
|
207 exe "norm A\<Tab>\<Tab>a\<Esc>" |
8f1f4f6c87ad
patch 8.2.4091: virtcol is recomputed for statusline unnecessarily
Bram Moolenaar <Bram@vim.org>
parents:
25907
diff
changeset
|
208 " In list mode a <Tab> is shown as "^I", which is 2-wide. |
8f1f4f6c87ad
patch 8.2.4091: virtcol is recomputed for statusline unnecessarily
Bram Moolenaar <Bram@vim.org>
parents:
25907
diff
changeset
|
209 call assert_match('^9,-9\s*$', s:get_statusline()) |
8f1f4f6c87ad
patch 8.2.4091: virtcol is recomputed for statusline unnecessarily
Bram Moolenaar <Bram@vim.org>
parents:
25907
diff
changeset
|
210 set list& |
8f1f4f6c87ad
patch 8.2.4091: virtcol is recomputed for statusline unnecessarily
Bram Moolenaar <Bram@vim.org>
parents:
25907
diff
changeset
|
211 " Now the second <Tab> ends at the 16th screen column. |
8f1f4f6c87ad
patch 8.2.4091: virtcol is recomputed for statusline unnecessarily
Bram Moolenaar <Bram@vim.org>
parents:
25907
diff
changeset
|
212 call assert_match('^17,-17\s*$', s:get_statusline()) |
8f1f4f6c87ad
patch 8.2.4091: virtcol is recomputed for statusline unnecessarily
Bram Moolenaar <Bram@vim.org>
parents:
25907
diff
changeset
|
213 undo |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
214 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
215 " %w: Preview window flag, text is "[Preview]". |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
216 " %W: Preview window flag, text is ",PRV". |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
217 set statusline=%w%W |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
218 call assert_match('^\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
219 pedit |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
220 wincmd j |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
221 call assert_match('^\[Preview\],PRV\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
222 pclose |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
223 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
224 " %y: Type of file in the buffer, e.g., "[vim]". See 'filetype'. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
225 " %Y: Type of file in the buffer, e.g., ",VIM". See 'filetype'. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
226 set statusline=%y\ %Y |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
227 call assert_match('^\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
228 setfiletype vim |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
229 call assert_match('^\[vim\] VIM\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
230 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
231 " %=: Separation point between left and right aligned items. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
232 set statusline=foo%=bar |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
233 call assert_match('^foo\s\+bar\s*$', s:get_statusline()) |
31936
82da100c0e45
patch 9.0.1300: 'statusline' only supports one "%=" item
Bram Moolenaar <Bram@vim.org>
parents:
31849
diff
changeset
|
234 set statusline=foo%=bar%=baz |
82da100c0e45
patch 9.0.1300: 'statusline' only supports one "%=" item
Bram Moolenaar <Bram@vim.org>
parents:
31849
diff
changeset
|
235 call assert_match('^foo\s\+bar\s\+baz\s*$', s:get_statusline()) |
82da100c0e45
patch 9.0.1300: 'statusline' only supports one "%=" item
Bram Moolenaar <Bram@vim.org>
parents:
31849
diff
changeset
|
236 set statusline=foo%=bar%=baz%=qux |
82da100c0e45
patch 9.0.1300: 'statusline' only supports one "%=" item
Bram Moolenaar <Bram@vim.org>
parents:
31849
diff
changeset
|
237 call assert_match('^foo\s\+bar\s\+baz\s\+qux\s*$', s:get_statusline()) |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
238 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
239 " Test min/max width, leading zeroes, left/right justify. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
240 set statusline=%04B |
16332
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
241 call cursor(9000, 1) |
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
242 call assert_match('^0039\s*$', s:get_statusline()) |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
243 set statusline=#%4B# |
16332
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
244 call assert_match('^# 39#\s*$', s:get_statusline()) |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
245 set statusline=#%-4B# |
16332
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
246 call assert_match('^#39 #\s*$', s:get_statusline()) |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
247 set statusline=%.6f |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
248 call assert_match('^<sline\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
249 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
250 " %<: Where to truncate. |
16332
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
251 " First check with when %< should not truncate with many columns |
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
252 exe 'set statusline=a%<b' . repeat('c', &columns - 3) . 'd' |
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
253 call assert_match('^abc\+d$', s:get_statusline()) |
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
254 exe 'set statusline=a' . repeat('b', &columns - 2) . '%<c' |
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
255 call assert_match('^ab\+c$', s:get_statusline()) |
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
256 " Then check when %< should truncate when there with too few columns. |
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
257 exe 'set statusline=a%<b' . repeat('c', &columns - 2) . 'd' |
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
258 call assert_match('^a<c\+d$', s:get_statusline()) |
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
259 exe 'set statusline=a' . repeat('b', &columns - 1) . '%<c' |
97e15f5b0082
patch 8.1.1171: statusline test could fail in large terminal
Bram Moolenaar <Bram@vim.org>
parents:
12684
diff
changeset
|
260 call assert_match('^ab\+>$', s:get_statusline()) |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
261 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
262 "%{: Evaluate expression between '%{' and '}' and substitute result. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
263 syntax on |
16740
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
264 let s:expected_curbuf = string(bufnr('')) |
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
265 let s:expected_curwin = string(win_getid()) |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
266 set statusline=%{SyntaxItem()} |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
267 call assert_match('^vimNumber\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
268 s/^/"/ |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
269 call assert_match('^vimLineComment\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
270 syntax off |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
271 |
28171
b4c111ea83b1
patch 8.2.4611: typos in tests; one lua line not covered by test
Bram Moolenaar <Bram@vim.org>
parents:
27124
diff
changeset
|
272 "%{%expr%}: evaluates expressions present in result of expr |
24630
4cf4d7a71fac
patch 8.2.2854: custom statusline cannot contain % items
Bram Moolenaar <Bram@vim.org>
parents:
24394
diff
changeset
|
273 func! Inner_eval() |
4cf4d7a71fac
patch 8.2.2854: custom statusline cannot contain % items
Bram Moolenaar <Bram@vim.org>
parents:
24394
diff
changeset
|
274 return '%n some other text' |
4cf4d7a71fac
patch 8.2.2854: custom statusline cannot contain % items
Bram Moolenaar <Bram@vim.org>
parents:
24394
diff
changeset
|
275 endfunc |
4cf4d7a71fac
patch 8.2.2854: custom statusline cannot contain % items
Bram Moolenaar <Bram@vim.org>
parents:
24394
diff
changeset
|
276 func! Outer_eval() |
4cf4d7a71fac
patch 8.2.2854: custom statusline cannot contain % items
Bram Moolenaar <Bram@vim.org>
parents:
24394
diff
changeset
|
277 return 'some text %{%Inner_eval()%}' |
4cf4d7a71fac
patch 8.2.2854: custom statusline cannot contain % items
Bram Moolenaar <Bram@vim.org>
parents:
24394
diff
changeset
|
278 endfunc |
4cf4d7a71fac
patch 8.2.2854: custom statusline cannot contain % items
Bram Moolenaar <Bram@vim.org>
parents:
24394
diff
changeset
|
279 set statusline=%{%Outer_eval()%} |
4cf4d7a71fac
patch 8.2.2854: custom statusline cannot contain % items
Bram Moolenaar <Bram@vim.org>
parents:
24394
diff
changeset
|
280 call assert_match('^some text ' . bufnr() . ' some other text\s*$', s:get_statusline()) |
4cf4d7a71fac
patch 8.2.2854: custom statusline cannot contain % items
Bram Moolenaar <Bram@vim.org>
parents:
24394
diff
changeset
|
281 delfunc Inner_eval |
4cf4d7a71fac
patch 8.2.2854: custom statusline cannot contain % items
Bram Moolenaar <Bram@vim.org>
parents:
24394
diff
changeset
|
282 delfunc Outer_eval |
4cf4d7a71fac
patch 8.2.2854: custom statusline cannot contain % items
Bram Moolenaar <Bram@vim.org>
parents:
24394
diff
changeset
|
283 |
4cf4d7a71fac
patch 8.2.2854: custom statusline cannot contain % items
Bram Moolenaar <Bram@vim.org>
parents:
24394
diff
changeset
|
284 "%{%expr%}: Doesn't get stuck in recursion |
4cf4d7a71fac
patch 8.2.2854: custom statusline cannot contain % items
Bram Moolenaar <Bram@vim.org>
parents:
24394
diff
changeset
|
285 func! Recurse_eval() |
4cf4d7a71fac
patch 8.2.2854: custom statusline cannot contain % items
Bram Moolenaar <Bram@vim.org>
parents:
24394
diff
changeset
|
286 return '%{%Recurse_eval()%}' |
4cf4d7a71fac
patch 8.2.2854: custom statusline cannot contain % items
Bram Moolenaar <Bram@vim.org>
parents:
24394
diff
changeset
|
287 endfunc |
4cf4d7a71fac
patch 8.2.2854: custom statusline cannot contain % items
Bram Moolenaar <Bram@vim.org>
parents:
24394
diff
changeset
|
288 set statusline=%{%Recurse_eval()%} |
4cf4d7a71fac
patch 8.2.2854: custom statusline cannot contain % items
Bram Moolenaar <Bram@vim.org>
parents:
24394
diff
changeset
|
289 call assert_match('^%{%Recurse_eval()%}\s*$', s:get_statusline()) |
4cf4d7a71fac
patch 8.2.2854: custom statusline cannot contain % items
Bram Moolenaar <Bram@vim.org>
parents:
24394
diff
changeset
|
290 delfunc Recurse_eval |
4cf4d7a71fac
patch 8.2.2854: custom statusline cannot contain % items
Bram Moolenaar <Bram@vim.org>
parents:
24394
diff
changeset
|
291 |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
292 "%(: Start of item group. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
293 set statusline=ab%(cd%q%)de |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
294 call assert_match('^abde\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
295 copen |
11525
14b6b79d685b
patch 8.0.0645: no error for illegal back reference in NFA engine
Christian Brabandt <cb@256bit.org>
parents:
11075
diff
changeset
|
296 call assert_match('^abcd\[Quickfix List]de\s*$', s:get_statusline()) |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
297 cclose |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
298 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
299 " %#: Set highlight group. The name must follow and then a # again. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
300 set statusline=ab%#Todo#cd%#Error#ef |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
301 call assert_match('^abcdef\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
302 let sa1=screenattr(&lines - 1, 1) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
303 let sa2=screenattr(&lines - 1, 3) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
304 let sa3=screenattr(&lines - 1, 5) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
305 call assert_notequal(sa1, sa2) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
306 call assert_notequal(sa1, sa3) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
307 call assert_notequal(sa2, sa3) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
308 call assert_equal(sa1, screenattr(&lines - 1, 2)) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
309 call assert_equal(sa2, screenattr(&lines - 1, 4)) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
310 call assert_equal(sa3, screenattr(&lines - 1, 6)) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
311 call assert_equal(sa3, screenattr(&lines - 1, 7)) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
312 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
313 " %*: Set highlight group to User{N} |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
314 set statusline=a%1*b%0*c |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
315 call assert_match('^abc\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
316 let sa1=screenattr(&lines - 1, 1) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
317 let sa2=screenattr(&lines - 1, 2) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
318 let sa3=screenattr(&lines - 1, 3) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
319 call assert_equal(sa1, sa3) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
320 call assert_notequal(sa1, sa2) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
321 |
12660
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
322 " An empty group that contains highlight changes |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
323 let g:a = '' |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
324 set statusline=ab%(cd%1*%{g:a}%*%)de |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
325 call assert_match('^abde\s*$', s:get_statusline()) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
326 let sa1=screenattr(&lines - 1, 1) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
327 let sa2=screenattr(&lines - 1, 4) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
328 call assert_equal(sa1, sa2) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
329 let g:a = 'X' |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
330 call assert_match('^abcdXde\s*$', s:get_statusline()) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
331 let sa1=screenattr(&lines - 1, 1) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
332 let sa2=screenattr(&lines - 1, 5) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
333 let sa3=screenattr(&lines - 1, 7) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
334 call assert_equal(sa1, sa3) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
335 call assert_notequal(sa1, sa2) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
336 |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
337 let g:a = '' |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
338 set statusline=ab%1*%(cd%*%{g:a}%1*%)de |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
339 call assert_match('^abde\s*$', s:get_statusline()) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
340 let sa1=screenattr(&lines - 1, 1) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
341 let sa2=screenattr(&lines - 1, 4) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
342 call assert_notequal(sa1, sa2) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
343 let g:a = 'X' |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
344 call assert_match('^abcdXde\s*$', s:get_statusline()) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
345 let sa1=screenattr(&lines - 1, 1) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
346 let sa2=screenattr(&lines - 1, 3) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
347 let sa3=screenattr(&lines - 1, 5) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
348 let sa4=screenattr(&lines - 1, 7) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
349 call assert_notequal(sa1, sa2) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
350 call assert_equal(sa1, sa3) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
351 call assert_equal(sa2, sa4) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
352 |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
353 " An empty group that contains highlight changes and doesn't reset them |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
354 let g:a = '' |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
355 set statusline=ab%(cd%1*%{g:a}%)de |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
356 call assert_match('^abcdde\s*$', s:get_statusline()) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
357 let sa1=screenattr(&lines - 1, 1) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
358 let sa2=screenattr(&lines - 1, 5) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
359 call assert_notequal(sa1, sa2) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
360 let g:a = 'X' |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
361 call assert_match('^abcdXde\s*$', s:get_statusline()) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
362 let sa1=screenattr(&lines - 1, 1) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
363 let sa2=screenattr(&lines - 1, 5) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
364 let sa3=screenattr(&lines - 1, 7) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
365 call assert_notequal(sa1, sa2) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
366 call assert_equal(sa2, sa3) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
367 |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
368 let g:a = '' |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
369 set statusline=ab%1*%(cd%*%{g:a}%)de |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
370 call assert_match('^abcdde\s*$', s:get_statusline()) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
371 let sa1=screenattr(&lines - 1, 1) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
372 let sa2=screenattr(&lines - 1, 3) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
373 let sa3=screenattr(&lines - 1, 5) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
374 call assert_notequal(sa1, sa2) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
375 call assert_equal(sa1, sa3) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
376 let g:a = 'X' |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
377 call assert_match('^abcdXde\s*$', s:get_statusline()) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
378 let sa1=screenattr(&lines - 1, 1) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
379 let sa2=screenattr(&lines - 1, 3) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
380 let sa3=screenattr(&lines - 1, 5) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
381 let sa4=screenattr(&lines - 1, 7) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
382 call assert_notequal(sa1, sa2) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
383 call assert_equal(sa1, sa3) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
384 call assert_equal(sa1, sa4) |
ac6e56d8950e
patch 8.0.1208: 'statusline' drops empty group with highlight change
Christian Brabandt <cb@256bit.org>
parents:
11525
diff
changeset
|
385 |
12684
185f8dbdcf26
patch 8.0.1220: skipping empty statusline groups is not correct
Christian Brabandt <cb@256bit.org>
parents:
12660
diff
changeset
|
386 let g:a = '' |
185f8dbdcf26
patch 8.0.1220: skipping empty statusline groups is not correct
Christian Brabandt <cb@256bit.org>
parents:
12660
diff
changeset
|
387 set statusline=%#Error#{%(\ %{g:a}\ %)} |
185f8dbdcf26
patch 8.0.1220: skipping empty statusline groups is not correct
Christian Brabandt <cb@256bit.org>
parents:
12660
diff
changeset
|
388 call assert_match('^{}\s*$', s:get_statusline()) |
185f8dbdcf26
patch 8.0.1220: skipping empty statusline groups is not correct
Christian Brabandt <cb@256bit.org>
parents:
12660
diff
changeset
|
389 let g:a = 'X' |
185f8dbdcf26
patch 8.0.1220: skipping empty statusline groups is not correct
Christian Brabandt <cb@256bit.org>
parents:
12660
diff
changeset
|
390 call assert_match('^{ X }\s*$', s:get_statusline()) |
185f8dbdcf26
patch 8.0.1220: skipping empty statusline groups is not correct
Christian Brabandt <cb@256bit.org>
parents:
12660
diff
changeset
|
391 |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
392 " %%: a percent sign. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
393 set statusline=10%% |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
394 call assert_match('^10%\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
395 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
396 " %!: evaluated expression is used as the option value |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
397 set statusline=%!2*3+1 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
398 call assert_match('7\s*$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
399 |
16740
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
400 func GetNested() |
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
401 call assert_equal(string(win_getid()), g:actual_curwin) |
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
402 call assert_equal(string(bufnr('')), g:actual_curbuf) |
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
403 return 'nested' |
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
404 endfunc |
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
405 func GetStatusLine() |
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
406 call assert_equal(win_getid(), g:statusline_winid) |
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
407 return 'the %{GetNested()} line' |
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
408 endfunc |
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
409 set statusline=%!GetStatusLine() |
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
410 call assert_match('the nested line', s:get_statusline()) |
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
411 call assert_false(exists('g:actual_curwin')) |
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
412 call assert_false(exists('g:actual_curbuf')) |
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
413 call assert_false(exists('g:statusline_winid')) |
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
414 delfunc GetNested |
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
415 delfunc GetStatusLine |
dc85d49349f7
patch 8.1.1372: when evaluating 'statusline' the current window is unknown
Bram Moolenaar <Bram@vim.org>
parents:
16332
diff
changeset
|
416 |
22721
92a100fc5e17
patch 8.2.1909: number of status line items is limited to 80
Bram Moolenaar <Bram@vim.org>
parents:
22464
diff
changeset
|
417 " Test statusline works with 80+ items |
92a100fc5e17
patch 8.2.1909: number of status line items is limited to 80
Bram Moolenaar <Bram@vim.org>
parents:
22464
diff
changeset
|
418 function! StatusLabel() |
92a100fc5e17
patch 8.2.1909: number of status line items is limited to 80
Bram Moolenaar <Bram@vim.org>
parents:
22464
diff
changeset
|
419 redrawstatus |
31849
dbec60b8c253
patch 9.0.1257: code style is not check in test scripts
Bram Moolenaar <Bram@vim.org>
parents:
31726
diff
changeset
|
420 return '[label]' |
22721
92a100fc5e17
patch 8.2.1909: number of status line items is limited to 80
Bram Moolenaar <Bram@vim.org>
parents:
22464
diff
changeset
|
421 endfunc |
92a100fc5e17
patch 8.2.1909: number of status line items is limited to 80
Bram Moolenaar <Bram@vim.org>
parents:
22464
diff
changeset
|
422 let statusline = '%{StatusLabel()}' |
92a100fc5e17
patch 8.2.1909: number of status line items is limited to 80
Bram Moolenaar <Bram@vim.org>
parents:
22464
diff
changeset
|
423 for i in range(150) |
92a100fc5e17
patch 8.2.1909: number of status line items is limited to 80
Bram Moolenaar <Bram@vim.org>
parents:
22464
diff
changeset
|
424 let statusline .= '%#TabLine' . (i % 2 == 0 ? 'Fill' : 'Sel') . '#' . string(i)[0] |
92a100fc5e17
patch 8.2.1909: number of status line items is limited to 80
Bram Moolenaar <Bram@vim.org>
parents:
22464
diff
changeset
|
425 endfor |
92a100fc5e17
patch 8.2.1909: number of status line items is limited to 80
Bram Moolenaar <Bram@vim.org>
parents:
22464
diff
changeset
|
426 let &statusline = statusline |
92a100fc5e17
patch 8.2.1909: number of status line items is limited to 80
Bram Moolenaar <Bram@vim.org>
parents:
22464
diff
changeset
|
427 redrawstatus |
92a100fc5e17
patch 8.2.1909: number of status line items is limited to 80
Bram Moolenaar <Bram@vim.org>
parents:
22464
diff
changeset
|
428 set statusline& |
92a100fc5e17
patch 8.2.1909: number of status line items is limited to 80
Bram Moolenaar <Bram@vim.org>
parents:
22464
diff
changeset
|
429 delfunc StatusLabel |
92a100fc5e17
patch 8.2.1909: number of status line items is limited to 80
Bram Moolenaar <Bram@vim.org>
parents:
22464
diff
changeset
|
430 |
92a100fc5e17
patch 8.2.1909: number of status line items is limited to 80
Bram Moolenaar <Bram@vim.org>
parents:
22464
diff
changeset
|
431 |
11075
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
432 " Check statusline in current and non-current window |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
433 " with the 'fillchars' option. |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
434 set fillchars=stl:^,stlnc:=,vert:\|,fold:-,diff:- |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
435 vsplit |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
436 set statusline=x%=y |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
437 call assert_match('^x^\+y^x=\+y$', s:get_statusline()) |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
438 set fillchars& |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
439 close |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
440 |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
441 %bw! |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
442 call delete('Xstatusline') |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
443 set statusline& |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
444 set splitbelow& |
a8be0c7169b1
patch 8.0.0426: insufficient testing for statusline
Christian Brabandt <cb@256bit.org>
parents:
8847
diff
changeset
|
445 endfunc |
18746
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
446 |
31622
1102f4777518
patch 9.0.1143: invalid memory access with bad 'statusline' value
Bram Moolenaar <Bram@vim.org>
parents:
31457
diff
changeset
|
447 func Test_statusline_trailing_percent_zero() |
1102f4777518
patch 9.0.1143: invalid memory access with bad 'statusline' value
Bram Moolenaar <Bram@vim.org>
parents:
31457
diff
changeset
|
448 " this was causing illegal memory access |
1102f4777518
patch 9.0.1143: invalid memory access with bad 'statusline' value
Bram Moolenaar <Bram@vim.org>
parents:
31457
diff
changeset
|
449 set laststatus=2 stl=%!%0 |
1102f4777518
patch 9.0.1143: invalid memory access with bad 'statusline' value
Bram Moolenaar <Bram@vim.org>
parents:
31457
diff
changeset
|
450 call assert_fails('redraw', 'E15: Invalid expression: "%0"') |
1102f4777518
patch 9.0.1143: invalid memory access with bad 'statusline' value
Bram Moolenaar <Bram@vim.org>
parents:
31457
diff
changeset
|
451 set laststatus& stl& |
1102f4777518
patch 9.0.1143: invalid memory access with bad 'statusline' value
Bram Moolenaar <Bram@vim.org>
parents:
31457
diff
changeset
|
452 endfunc |
1102f4777518
patch 9.0.1143: invalid memory access with bad 'statusline' value
Bram Moolenaar <Bram@vim.org>
parents:
31457
diff
changeset
|
453 |
18746
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
454 func Test_statusline_visual() |
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
455 func CallWordcount() |
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
456 call wordcount() |
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
457 endfunc |
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
458 new x1 |
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
459 setl statusline=count=%{CallWordcount()} |
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
460 " buffer must not be empty |
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
461 call setline(1, 'hello') |
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
462 |
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
463 " window with more lines than x1 |
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
464 new x2 |
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
465 call setline(1, range(10)) |
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
466 $ |
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
467 " Visual mode in line below liast line in x1 should not give ml_get error |
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
468 call feedkeys("\<C-V>", "xt") |
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
469 redraw |
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
470 |
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
471 delfunc CallWordcount |
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
472 bwipe! x1 |
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
473 bwipe! x2 |
64eea864dff6
patch 8.1.2363: ml_get error when accessing Visual area in 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
16740
diff
changeset
|
474 endfunc |
19354
1d3b2ce65ae0
patch 8.2.0235: draw error when an empty group is removed from 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
475 |
1d3b2ce65ae0
patch 8.2.0235: draw error when an empty group is removed from 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
476 func Test_statusline_removed_group() |
1d3b2ce65ae0
patch 8.2.0235: draw error when an empty group is removed from 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
477 CheckScreendump |
1d3b2ce65ae0
patch 8.2.0235: draw error when an empty group is removed from 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
478 |
1d3b2ce65ae0
patch 8.2.0235: draw error when an empty group is removed from 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
479 let lines =<< trim END |
1d3b2ce65ae0
patch 8.2.0235: draw error when an empty group is removed from 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
480 scriptencoding utf-8 |
1d3b2ce65ae0
patch 8.2.0235: draw error when an empty group is removed from 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
481 set laststatus=2 |
1d3b2ce65ae0
patch 8.2.0235: draw error when an empty group is removed from 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
482 let &statusline = '%#StatColorHi2#%(✓%#StatColorHi2#%) Q≡' |
1d3b2ce65ae0
patch 8.2.0235: draw error when an empty group is removed from 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
483 END |
30769
ae10b91ac6b3
patch 9.0.0719: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
29434
diff
changeset
|
484 call writefile(lines, 'XTest_statusline', 'D') |
19354
1d3b2ce65ae0
patch 8.2.0235: draw error when an empty group is removed from 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
485 |
1d3b2ce65ae0
patch 8.2.0235: draw error when an empty group is removed from 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
486 let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 10, 'cols': 50}) |
1d3b2ce65ae0
patch 8.2.0235: draw error when an empty group is removed from 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
487 call VerifyScreenDump(buf, 'Test_statusline_1', {}) |
1d3b2ce65ae0
patch 8.2.0235: draw error when an empty group is removed from 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
488 |
1d3b2ce65ae0
patch 8.2.0235: draw error when an empty group is removed from 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
489 " clean up |
1d3b2ce65ae0
patch 8.2.0235: draw error when an empty group is removed from 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
490 call StopVimInTerminal(buf) |
1d3b2ce65ae0
patch 8.2.0235: draw error when an empty group is removed from 'statusline'
Bram Moolenaar <Bram@vim.org>
parents:
18767
diff
changeset
|
491 endfunc |
21004
0650d220f742
patch 8.2.1053: insufficient testing for 'statusline' and 'tabline'
Bram Moolenaar <Bram@vim.org>
parents:
20984
diff
changeset
|
492 |
24291
93b401236991
patch 8.2.2686: status line is not updated when going to cmdline mode
Bram Moolenaar <Bram@vim.org>
parents:
24055
diff
changeset
|
493 func Test_statusline_using_mode() |
93b401236991
patch 8.2.2686: status line is not updated when going to cmdline mode
Bram Moolenaar <Bram@vim.org>
parents:
24055
diff
changeset
|
494 CheckScreendump |
93b401236991
patch 8.2.2686: status line is not updated when going to cmdline mode
Bram Moolenaar <Bram@vim.org>
parents:
24055
diff
changeset
|
495 |
93b401236991
patch 8.2.2686: status line is not updated when going to cmdline mode
Bram Moolenaar <Bram@vim.org>
parents:
24055
diff
changeset
|
496 let lines =<< trim END |
24394
5858745d393a
patch 8.2.2737: status line not updated when local 'statusline' option set
Bram Moolenaar <Bram@vim.org>
parents:
24291
diff
changeset
|
497 setlocal statusline=-%{mode()}- |
5858745d393a
patch 8.2.2737: status line not updated when local 'statusline' option set
Bram Moolenaar <Bram@vim.org>
parents:
24291
diff
changeset
|
498 split |
5858745d393a
patch 8.2.2737: status line not updated when local 'statusline' option set
Bram Moolenaar <Bram@vim.org>
parents:
24291
diff
changeset
|
499 setlocal statusline=+%{mode()}+ |
24291
93b401236991
patch 8.2.2686: status line is not updated when going to cmdline mode
Bram Moolenaar <Bram@vim.org>
parents:
24055
diff
changeset
|
500 END |
30769
ae10b91ac6b3
patch 9.0.0719: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
29434
diff
changeset
|
501 call writefile(lines, 'XTest_statusline', 'D') |
24291
93b401236991
patch 8.2.2686: status line is not updated when going to cmdline mode
Bram Moolenaar <Bram@vim.org>
parents:
24055
diff
changeset
|
502 |
24394
5858745d393a
patch 8.2.2737: status line not updated when local 'statusline' option set
Bram Moolenaar <Bram@vim.org>
parents:
24291
diff
changeset
|
503 let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 7, 'cols': 50}) |
24291
93b401236991
patch 8.2.2686: status line is not updated when going to cmdline mode
Bram Moolenaar <Bram@vim.org>
parents:
24055
diff
changeset
|
504 call VerifyScreenDump(buf, 'Test_statusline_mode_1', {}) |
93b401236991
patch 8.2.2686: status line is not updated when going to cmdline mode
Bram Moolenaar <Bram@vim.org>
parents:
24055
diff
changeset
|
505 |
93b401236991
patch 8.2.2686: status line is not updated when going to cmdline mode
Bram Moolenaar <Bram@vim.org>
parents:
24055
diff
changeset
|
506 call term_sendkeys(buf, ":") |
93b401236991
patch 8.2.2686: status line is not updated when going to cmdline mode
Bram Moolenaar <Bram@vim.org>
parents:
24055
diff
changeset
|
507 call VerifyScreenDump(buf, 'Test_statusline_mode_2', {}) |
93b401236991
patch 8.2.2686: status line is not updated when going to cmdline mode
Bram Moolenaar <Bram@vim.org>
parents:
24055
diff
changeset
|
508 |
93b401236991
patch 8.2.2686: status line is not updated when going to cmdline mode
Bram Moolenaar <Bram@vim.org>
parents:
24055
diff
changeset
|
509 " clean up |
24394
5858745d393a
patch 8.2.2737: status line not updated when local 'statusline' option set
Bram Moolenaar <Bram@vim.org>
parents:
24291
diff
changeset
|
510 call term_sendkeys(buf, "close\<CR>") |
24291
93b401236991
patch 8.2.2686: status line is not updated when going to cmdline mode
Bram Moolenaar <Bram@vim.org>
parents:
24055
diff
changeset
|
511 call StopVimInTerminal(buf) |
93b401236991
patch 8.2.2686: status line is not updated when going to cmdline mode
Bram Moolenaar <Bram@vim.org>
parents:
24055
diff
changeset
|
512 endfunc |
93b401236991
patch 8.2.2686: status line is not updated when going to cmdline mode
Bram Moolenaar <Bram@vim.org>
parents:
24055
diff
changeset
|
513 |
22464
b74bdd85bb26
patch 8.2.1780: statusline not updated when splitting windows
Bram Moolenaar <Bram@vim.org>
parents:
21004
diff
changeset
|
514 func Test_statusline_after_split_vsplit() |
b74bdd85bb26
patch 8.2.1780: statusline not updated when splitting windows
Bram Moolenaar <Bram@vim.org>
parents:
21004
diff
changeset
|
515 only |
b74bdd85bb26
patch 8.2.1780: statusline not updated when splitting windows
Bram Moolenaar <Bram@vim.org>
parents:
21004
diff
changeset
|
516 |
b74bdd85bb26
patch 8.2.1780: statusline not updated when splitting windows
Bram Moolenaar <Bram@vim.org>
parents:
21004
diff
changeset
|
517 " Make the status line of each window show the window number. |
b74bdd85bb26
patch 8.2.1780: statusline not updated when splitting windows
Bram Moolenaar <Bram@vim.org>
parents:
21004
diff
changeset
|
518 set ls=2 stl=%{winnr()} |
b74bdd85bb26
patch 8.2.1780: statusline not updated when splitting windows
Bram Moolenaar <Bram@vim.org>
parents:
21004
diff
changeset
|
519 |
b74bdd85bb26
patch 8.2.1780: statusline not updated when splitting windows
Bram Moolenaar <Bram@vim.org>
parents:
21004
diff
changeset
|
520 split | redraw |
b74bdd85bb26
patch 8.2.1780: statusline not updated when splitting windows
Bram Moolenaar <Bram@vim.org>
parents:
21004
diff
changeset
|
521 vsplit | redraw |
b74bdd85bb26
patch 8.2.1780: statusline not updated when splitting windows
Bram Moolenaar <Bram@vim.org>
parents:
21004
diff
changeset
|
522 |
b74bdd85bb26
patch 8.2.1780: statusline not updated when splitting windows
Bram Moolenaar <Bram@vim.org>
parents:
21004
diff
changeset
|
523 " The status line of the third window should read '3' here. |
b74bdd85bb26
patch 8.2.1780: statusline not updated when splitting windows
Bram Moolenaar <Bram@vim.org>
parents:
21004
diff
changeset
|
524 call assert_equal('3', nr2char(screenchar(&lines - 1, 1))) |
b74bdd85bb26
patch 8.2.1780: statusline not updated when splitting windows
Bram Moolenaar <Bram@vim.org>
parents:
21004
diff
changeset
|
525 |
b74bdd85bb26
patch 8.2.1780: statusline not updated when splitting windows
Bram Moolenaar <Bram@vim.org>
parents:
21004
diff
changeset
|
526 only |
b74bdd85bb26
patch 8.2.1780: statusline not updated when splitting windows
Bram Moolenaar <Bram@vim.org>
parents:
21004
diff
changeset
|
527 set ls& stl& |
b74bdd85bb26
patch 8.2.1780: statusline not updated when splitting windows
Bram Moolenaar <Bram@vim.org>
parents:
21004
diff
changeset
|
528 endfunc |
b74bdd85bb26
patch 8.2.1780: statusline not updated when splitting windows
Bram Moolenaar <Bram@vim.org>
parents:
21004
diff
changeset
|
529 |
24055
90d1636a8fcb
patch 8.2.2569: 'fillchars' "stl" and "stlnc" items must be single byte
Bram Moolenaar <Bram@vim.org>
parents:
22721
diff
changeset
|
530 " Test using a multibyte character for 'stl' and 'stlnc' items in 'fillchars' |
90d1636a8fcb
patch 8.2.2569: 'fillchars' "stl" and "stlnc" items must be single byte
Bram Moolenaar <Bram@vim.org>
parents:
22721
diff
changeset
|
531 " with a custom 'statusline' |
90d1636a8fcb
patch 8.2.2569: 'fillchars' "stl" and "stlnc" items must be single byte
Bram Moolenaar <Bram@vim.org>
parents:
22721
diff
changeset
|
532 func Test_statusline_mbyte_fillchar() |
90d1636a8fcb
patch 8.2.2569: 'fillchars' "stl" and "stlnc" items must be single byte
Bram Moolenaar <Bram@vim.org>
parents:
22721
diff
changeset
|
533 only |
90d1636a8fcb
patch 8.2.2569: 'fillchars' "stl" and "stlnc" items must be single byte
Bram Moolenaar <Bram@vim.org>
parents:
22721
diff
changeset
|
534 set fillchars=vert:\|,fold:-,stl:━,stlnc:═ |
90d1636a8fcb
patch 8.2.2569: 'fillchars' "stl" and "stlnc" items must be single byte
Bram Moolenaar <Bram@vim.org>
parents:
22721
diff
changeset
|
535 set statusline=a%=b |
90d1636a8fcb
patch 8.2.2569: 'fillchars' "stl" and "stlnc" items must be single byte
Bram Moolenaar <Bram@vim.org>
parents:
22721
diff
changeset
|
536 call assert_match('^a\+━\+b$', s:get_statusline()) |
90d1636a8fcb
patch 8.2.2569: 'fillchars' "stl" and "stlnc" items must be single byte
Bram Moolenaar <Bram@vim.org>
parents:
22721
diff
changeset
|
537 vnew |
90d1636a8fcb
patch 8.2.2569: 'fillchars' "stl" and "stlnc" items must be single byte
Bram Moolenaar <Bram@vim.org>
parents:
22721
diff
changeset
|
538 call assert_match('^a\+━\+b━a\+═\+b$', s:get_statusline()) |
90d1636a8fcb
patch 8.2.2569: 'fillchars' "stl" and "stlnc" items must be single byte
Bram Moolenaar <Bram@vim.org>
parents:
22721
diff
changeset
|
539 wincmd w |
90d1636a8fcb
patch 8.2.2569: 'fillchars' "stl" and "stlnc" items must be single byte
Bram Moolenaar <Bram@vim.org>
parents:
22721
diff
changeset
|
540 call assert_match('^a\+═\+b═a\+━\+b$', s:get_statusline()) |
29434
5da38c4ffe92
patch 9.0.0059: test file has wrong name
Bram Moolenaar <Bram@vim.org>
parents:
28811
diff
changeset
|
541 set statusline& fillchars& |
24055
90d1636a8fcb
patch 8.2.2569: 'fillchars' "stl" and "stlnc" items must be single byte
Bram Moolenaar <Bram@vim.org>
parents:
22721
diff
changeset
|
542 %bw! |
90d1636a8fcb
patch 8.2.2569: 'fillchars' "stl" and "stlnc" items must be single byte
Bram Moolenaar <Bram@vim.org>
parents:
22721
diff
changeset
|
543 endfunc |
22464
b74bdd85bb26
patch 8.2.1780: statusline not updated when splitting windows
Bram Moolenaar <Bram@vim.org>
parents:
21004
diff
changeset
|
544 |
25907
637588377056
patch 8.2.3487: illegal memory access if buffer name is very long
Bram Moolenaar <Bram@vim.org>
parents:
24630
diff
changeset
|
545 " Used to write beyond allocated memory. This assumes MAXPATHL is 4096 bytes. |
637588377056
patch 8.2.3487: illegal memory access if buffer name is very long
Bram Moolenaar <Bram@vim.org>
parents:
24630
diff
changeset
|
546 func Test_statusline_verylong_filename() |
637588377056
patch 8.2.3487: illegal memory access if buffer name is very long
Bram Moolenaar <Bram@vim.org>
parents:
24630
diff
changeset
|
547 let fname = repeat('x', 4090) |
637588377056
patch 8.2.3487: illegal memory access if buffer name is very long
Bram Moolenaar <Bram@vim.org>
parents:
24630
diff
changeset
|
548 exe "new " .. fname |
637588377056
patch 8.2.3487: illegal memory access if buffer name is very long
Bram Moolenaar <Bram@vim.org>
parents:
24630
diff
changeset
|
549 set buftype=help |
637588377056
patch 8.2.3487: illegal memory access if buffer name is very long
Bram Moolenaar <Bram@vim.org>
parents:
24630
diff
changeset
|
550 set previewwindow |
637588377056
patch 8.2.3487: illegal memory access if buffer name is very long
Bram Moolenaar <Bram@vim.org>
parents:
24630
diff
changeset
|
551 redraw |
637588377056
patch 8.2.3487: illegal memory access if buffer name is very long
Bram Moolenaar <Bram@vim.org>
parents:
24630
diff
changeset
|
552 bwipe! |
637588377056
patch 8.2.3487: illegal memory access if buffer name is very long
Bram Moolenaar <Bram@vim.org>
parents:
24630
diff
changeset
|
553 endfunc |
637588377056
patch 8.2.3487: illegal memory access if buffer name is very long
Bram Moolenaar <Bram@vim.org>
parents:
24630
diff
changeset
|
554 |
28811
bd5b6ac5998f
patch 8.2.4929: off-by-one error in in statusline item
Bram Moolenaar <Bram@vim.org>
parents:
28171
diff
changeset
|
555 func Test_statusline_highlight_truncate() |
bd5b6ac5998f
patch 8.2.4929: off-by-one error in in statusline item
Bram Moolenaar <Bram@vim.org>
parents:
28171
diff
changeset
|
556 CheckScreendump |
bd5b6ac5998f
patch 8.2.4929: off-by-one error in in statusline item
Bram Moolenaar <Bram@vim.org>
parents:
28171
diff
changeset
|
557 |
bd5b6ac5998f
patch 8.2.4929: off-by-one error in in statusline item
Bram Moolenaar <Bram@vim.org>
parents:
28171
diff
changeset
|
558 let lines =<< trim END |
bd5b6ac5998f
patch 8.2.4929: off-by-one error in in statusline item
Bram Moolenaar <Bram@vim.org>
parents:
28171
diff
changeset
|
559 set laststatus=2 |
bd5b6ac5998f
patch 8.2.4929: off-by-one error in in statusline item
Bram Moolenaar <Bram@vim.org>
parents:
28171
diff
changeset
|
560 hi! link User1 Directory |
bd5b6ac5998f
patch 8.2.4929: off-by-one error in in statusline item
Bram Moolenaar <Bram@vim.org>
parents:
28171
diff
changeset
|
561 hi! link User2 ErrorMsg |
bd5b6ac5998f
patch 8.2.4929: off-by-one error in in statusline item
Bram Moolenaar <Bram@vim.org>
parents:
28171
diff
changeset
|
562 set statusline=%.5(%1*ABC%2*DEF%1*GHI%) |
bd5b6ac5998f
patch 8.2.4929: off-by-one error in in statusline item
Bram Moolenaar <Bram@vim.org>
parents:
28171
diff
changeset
|
563 END |
30769
ae10b91ac6b3
patch 9.0.0719: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
29434
diff
changeset
|
564 call writefile(lines, 'XTest_statusline', 'D') |
28811
bd5b6ac5998f
patch 8.2.4929: off-by-one error in in statusline item
Bram Moolenaar <Bram@vim.org>
parents:
28171
diff
changeset
|
565 |
bd5b6ac5998f
patch 8.2.4929: off-by-one error in in statusline item
Bram Moolenaar <Bram@vim.org>
parents:
28171
diff
changeset
|
566 let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 6}) |
bd5b6ac5998f
patch 8.2.4929: off-by-one error in in statusline item
Bram Moolenaar <Bram@vim.org>
parents:
28171
diff
changeset
|
567 call VerifyScreenDump(buf, 'Test_statusline_hl', {}) |
bd5b6ac5998f
patch 8.2.4929: off-by-one error in in statusline item
Bram Moolenaar <Bram@vim.org>
parents:
28171
diff
changeset
|
568 |
bd5b6ac5998f
patch 8.2.4929: off-by-one error in in statusline item
Bram Moolenaar <Bram@vim.org>
parents:
28171
diff
changeset
|
569 call StopVimInTerminal(buf) |
bd5b6ac5998f
patch 8.2.4929: off-by-one error in in statusline item
Bram Moolenaar <Bram@vim.org>
parents:
28171
diff
changeset
|
570 endfunc |
bd5b6ac5998f
patch 8.2.4929: off-by-one error in in statusline item
Bram Moolenaar <Bram@vim.org>
parents:
28171
diff
changeset
|
571 |
31457
bb797331e21b
patch 9.0.1061: cannot display 'showcmd' somewhere else
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
572 func Test_statusline_showcmd() |
bb797331e21b
patch 9.0.1061: cannot display 'showcmd' somewhere else
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
573 CheckScreendump |
bb797331e21b
patch 9.0.1061: cannot display 'showcmd' somewhere else
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
574 |
bb797331e21b
patch 9.0.1061: cannot display 'showcmd' somewhere else
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
575 let lines =<< trim END |
31726
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
576 func MyStatusLine() |
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
577 return '%S' |
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
578 endfunc |
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
579 |
31457
bb797331e21b
patch 9.0.1061: cannot display 'showcmd' somewhere else
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
580 set laststatus=2 |
31726
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
581 set statusline=%!MyStatusLine() |
31457
bb797331e21b
patch 9.0.1061: cannot display 'showcmd' somewhere else
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
582 set showcmdloc=statusline |
bb797331e21b
patch 9.0.1061: cannot display 'showcmd' somewhere else
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
583 call setline(1, ['a', 'b', 'c']) |
31726
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
584 set foldopen+=jump |
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
585 1,2fold |
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
586 3 |
31457
bb797331e21b
patch 9.0.1061: cannot display 'showcmd' somewhere else
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
587 END |
bb797331e21b
patch 9.0.1061: cannot display 'showcmd' somewhere else
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
588 call writefile(lines, 'XTest_statusline', 'D') |
bb797331e21b
patch 9.0.1061: cannot display 'showcmd' somewhere else
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
589 |
bb797331e21b
patch 9.0.1061: cannot display 'showcmd' somewhere else
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
590 let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 6}) |
31726
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
591 |
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
592 call term_sendkeys(buf, "g") |
31457
bb797331e21b
patch 9.0.1061: cannot display 'showcmd' somewhere else
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
593 call VerifyScreenDump(buf, 'Test_statusline_showcmd_1', {}) |
bb797331e21b
patch 9.0.1061: cannot display 'showcmd' somewhere else
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
594 |
31726
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
595 " typing "gg" should open the fold |
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
596 call term_sendkeys(buf, "g") |
31457
bb797331e21b
patch 9.0.1061: cannot display 'showcmd' somewhere else
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
597 call VerifyScreenDump(buf, 'Test_statusline_showcmd_2', {}) |
bb797331e21b
patch 9.0.1061: cannot display 'showcmd' somewhere else
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
598 |
31726
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
599 call term_sendkeys(buf, "\<C-V>Gl") |
31457
bb797331e21b
patch 9.0.1061: cannot display 'showcmd' somewhere else
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
600 call VerifyScreenDump(buf, 'Test_statusline_showcmd_3', {}) |
31726
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
601 |
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
602 call term_sendkeys(buf, "\<Esc>1234") |
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
603 call VerifyScreenDump(buf, 'Test_statusline_showcmd_4', {}) |
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
604 |
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
605 call term_sendkeys(buf, "\<Esc>:set statusline=\<CR>") |
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
606 call term_sendkeys(buf, ":\<CR>") |
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
607 call term_sendkeys(buf, "1234") |
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
608 call VerifyScreenDump(buf, 'Test_statusline_showcmd_5', {}) |
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
609 |
122cfa668b95
patch 9.0.1195: restoring KeyTyped when building statusline not tested
Bram Moolenaar <Bram@vim.org>
parents:
31622
diff
changeset
|
610 call StopVimInTerminal(buf) |
31457
bb797331e21b
patch 9.0.1061: cannot display 'showcmd' somewhere else
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
611 endfunc |
bb797331e21b
patch 9.0.1061: cannot display 'showcmd' somewhere else
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
612 |
33732
b140246564f4
patch 9.0.2095: statusline may look different than expected
Christian Brabandt <cb@256bit.org>
parents:
31936
diff
changeset
|
613 func Test_statusline_highlight_group_cleared() |
b140246564f4
patch 9.0.2095: statusline may look different than expected
Christian Brabandt <cb@256bit.org>
parents:
31936
diff
changeset
|
614 CheckScreendump |
b140246564f4
patch 9.0.2095: statusline may look different than expected
Christian Brabandt <cb@256bit.org>
parents:
31936
diff
changeset
|
615 |
b140246564f4
patch 9.0.2095: statusline may look different than expected
Christian Brabandt <cb@256bit.org>
parents:
31936
diff
changeset
|
616 " the laststatus option is there to prevent |
b140246564f4
patch 9.0.2095: statusline may look different than expected
Christian Brabandt <cb@256bit.org>
parents:
31936
diff
changeset
|
617 " the code-style test from complaining about |
b140246564f4
patch 9.0.2095: statusline may look different than expected
Christian Brabandt <cb@256bit.org>
parents:
31936
diff
changeset
|
618 " trailing whitespace |
b140246564f4
patch 9.0.2095: statusline may look different than expected
Christian Brabandt <cb@256bit.org>
parents:
31936
diff
changeset
|
619 let lines =<< trim END |
b140246564f4
patch 9.0.2095: statusline may look different than expected
Christian Brabandt <cb@256bit.org>
parents:
31936
diff
changeset
|
620 set fillchars=stl:\ ,stlnc:\ laststatus=2 |
b140246564f4
patch 9.0.2095: statusline may look different than expected
Christian Brabandt <cb@256bit.org>
parents:
31936
diff
changeset
|
621 split |
b140246564f4
patch 9.0.2095: statusline may look different than expected
Christian Brabandt <cb@256bit.org>
parents:
31936
diff
changeset
|
622 hi clear StatusLine |
b140246564f4
patch 9.0.2095: statusline may look different than expected
Christian Brabandt <cb@256bit.org>
parents:
31936
diff
changeset
|
623 hi clear StatusLineNC |
b140246564f4
patch 9.0.2095: statusline may look different than expected
Christian Brabandt <cb@256bit.org>
parents:
31936
diff
changeset
|
624 END |
b140246564f4
patch 9.0.2095: statusline may look different than expected
Christian Brabandt <cb@256bit.org>
parents:
31936
diff
changeset
|
625 call writefile(lines, 'XTest_statusline_stl', 'D') |
b140246564f4
patch 9.0.2095: statusline may look different than expected
Christian Brabandt <cb@256bit.org>
parents:
31936
diff
changeset
|
626 |
b140246564f4
patch 9.0.2095: statusline may look different than expected
Christian Brabandt <cb@256bit.org>
parents:
31936
diff
changeset
|
627 let buf = RunVimInTerminal('-S XTest_statusline_stl', {}) |
b140246564f4
patch 9.0.2095: statusline may look different than expected
Christian Brabandt <cb@256bit.org>
parents:
31936
diff
changeset
|
628 |
b140246564f4
patch 9.0.2095: statusline may look different than expected
Christian Brabandt <cb@256bit.org>
parents:
31936
diff
changeset
|
629 call VerifyScreenDump(buf, 'Test_statusline_stl_1', {}) |
b140246564f4
patch 9.0.2095: statusline may look different than expected
Christian Brabandt <cb@256bit.org>
parents:
31936
diff
changeset
|
630 |
b140246564f4
patch 9.0.2095: statusline may look different than expected
Christian Brabandt <cb@256bit.org>
parents:
31936
diff
changeset
|
631 call StopVimInTerminal(buf) |
b140246564f4
patch 9.0.2095: statusline may look different than expected
Christian Brabandt <cb@256bit.org>
parents:
31936
diff
changeset
|
632 endfunc |
b140246564f4
patch 9.0.2095: statusline may look different than expected
Christian Brabandt <cb@256bit.org>
parents:
31936
diff
changeset
|
633 |
21004
0650d220f742
patch 8.2.1053: insufficient testing for 'statusline' and 'tabline'
Bram Moolenaar <Bram@vim.org>
parents:
20984
diff
changeset
|
634 " vim: shiftwidth=2 sts=2 expandtab |