Mercurial > vim
annotate src/testdir/test_number.vim @ 34645:172f30203d25 v9.1.0207
patch 9.1.0207: No autocommand when writing session file
Commit: https://github.com/vim/vim/commit/e5f2280381250801a28dcff9823e6f94e7b163fc
Author: Colin Kennedy <colinvfx@gmail.com>
Date: Tue Mar 26 18:20:16 2024 +0100
patch 9.1.0207: No autocommand when writing session file
Problem: No autocommand when writing session file
Solution: Add SessionWritePost autocommand
(Colin Kennedy)
fixes: ##14242
closes: #14288
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Colin Kennedy <colinvfx@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 26 Mar 2024 18:30:03 +0100 |
parents | 0690fd6f9d48 |
children |
rev | line source |
---|---|
10940
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Test for 'number' and 'relativenumber' |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
18471
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
3 source check.vim |
10940
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 source view_util.vim |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 |
18471
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
6 source screendump.vim |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
7 |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
10940
diff
changeset
|
8 func s:screen_lines(start, end) abort |
10940
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 return ScreenLines([a:start, a:end], 8) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 endfunc |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
10940
diff
changeset
|
12 func s:compare_lines(expect, actual) |
10940
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 call assert_equal(a:expect, a:actual) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 endfunc |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
10940
diff
changeset
|
16 func s:test_windows(h, w) abort |
10940
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 call NewWindow(a:h, a:w) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 endfunc |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
10940
diff
changeset
|
20 func s:close_windows() abort |
10940
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 call CloseWindow() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 endfunc |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
10940
diff
changeset
|
24 func s:validate_cursor() abort |
10940
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 " update skipcol. |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 " wincol(): |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 " f_wincol |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 " -> validate_cursor |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 " -> curs_columns |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 call wincol() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 endfunc |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 func Test_set_options() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 set nu rnu |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 call assert_equal(1, &nu) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 call assert_equal(1, &rnu) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 call s:test_windows(10, 20) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 call assert_equal(1, &nu) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 call assert_equal(1, &rnu) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 call s:close_windows() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 set nu& rnu& |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
44 endfunc |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
45 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 func Test_set_global_and_local() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
47 " setlocal must NOT reset the other global value |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
48 set nonu nornu |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
49 setglobal nu |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
50 setlocal rnu |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
51 call assert_equal(1, &g:nu) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
52 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
53 set nonu nornu |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
54 setglobal rnu |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
55 setlocal nu |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
56 call assert_equal(1, &g:rnu) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
57 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
58 " setglobal MUST reset the other global value |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
59 set nonu nornu |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
60 setglobal nu |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
61 setglobal rnu |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
62 call assert_equal(1, &g:nu) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
63 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
64 set nonu nornu |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
65 setglobal rnu |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
66 setglobal nu |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
67 call assert_equal(1, &g:rnu) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
68 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
69 " set MUST reset the other global value |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
70 set nonu nornu |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
71 set nu |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
72 set rnu |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
73 call assert_equal(1, &g:nu) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
74 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
75 set nonu nornu |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
76 set rnu |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
77 set nu |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
78 call assert_equal(1, &g:rnu) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
79 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
80 set nu& rnu& |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
81 endfunc |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
82 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
83 func Test_number() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
84 call s:test_windows(10, 20) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
85 call setline(1, ["abcdefghij", "klmnopqrst", "uvwxyzABCD", "EFGHIJKLMN", "OPQRSTUVWX", "YZ"]) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
86 setl number |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
87 let lines = s:screen_lines(1, 4) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
88 let expect = [ |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
89 \ " 1 abcd", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
90 \ " 2 klmn", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
91 \ " 3 uvwx", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
92 \ " 4 EFGH", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
93 \ ] |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
94 call s:compare_lines(expect, lines) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
95 call s:close_windows() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
96 endfunc |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
97 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
98 func Test_relativenumber() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
99 call s:test_windows(10, 20) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
100 call setline(1, ["abcdefghij", "klmnopqrst", "uvwxyzABCD", "EFGHIJKLMN", "OPQRSTUVWX", "YZ"]) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
101 3 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
102 setl relativenumber |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
103 let lines = s:screen_lines(1, 6) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
104 let expect = [ |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
105 \ " 2 abcd", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
106 \ " 1 klmn", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
107 \ " 0 uvwx", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
108 \ " 1 EFGH", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
109 \ " 2 OPQR", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
110 \ " 3 YZ ", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
111 \ ] |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
112 call s:compare_lines(expect, lines) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
113 call s:close_windows() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
114 endfunc |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
115 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
116 func Test_number_with_relativenumber() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
117 call s:test_windows(10, 20) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
118 call setline(1, ["abcdefghij", "klmnopqrst", "uvwxyzABCD", "EFGHIJKLMN", "OPQRSTUVWX", "YZ"]) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
119 4 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
120 setl number relativenumber |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
121 let lines = s:screen_lines(1, 6) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
122 let expect = [ |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
123 \ " 3 abcd", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
124 \ " 2 klmn", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
125 \ " 1 uvwx", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
126 \ "4 EFGH", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
127 \ " 1 OPQR", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
128 \ " 2 YZ ", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
129 \ ] |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
130 call s:compare_lines(expect, lines) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
131 call s:close_windows() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
132 endfunc |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
133 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
134 func Test_number_with_linewrap1() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
135 call s:test_windows(3, 20) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
136 normal! 61ia |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
137 setl number wrap |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
138 call s:validate_cursor() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
139 let lines = s:screen_lines(1, 3) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
140 let expect = [ |
30630
218363931f5d
patch 9.0.0650: some tests are failing
Bram Moolenaar <Bram@vim.org>
parents:
30582
diff
changeset
|
141 \ "<<< aaaa", |
10940
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
142 \ " aaaa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
143 \ " aaaa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
144 \ ] |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
145 call s:compare_lines(expect, lines) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
146 call s:close_windows() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
147 endfunc |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
148 |
34296
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
149 func Test_number_with_linewrap2() |
10940
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
150 call s:test_windows(3, 20) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
151 normal! 61ia |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
152 setl number wrap |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
153 call s:validate_cursor() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
154 0 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
155 call s:validate_cursor() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
156 let lines = s:screen_lines(1, 3) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
157 let expect = [ |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
158 \ " 1 aaaa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
159 \ " aaaa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
160 \ " aaaa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
161 \ ] |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
162 call s:compare_lines(expect, lines) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
163 call s:close_windows() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
164 endfunc |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
165 |
34296
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
166 func Test_number_with_linewrap3() |
10940
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
167 call s:test_windows(4, 20) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
168 normal! 81ia |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
169 setl number wrap |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
170 call s:validate_cursor() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
171 setl nonumber |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
172 call s:validate_cursor() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
173 let lines = s:screen_lines(1, 4) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
174 let expect = [ |
34296
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
175 \ "<<<aaaaa", |
10940
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
176 \ "aaaaaaaa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
177 \ "aaaaaaaa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
178 \ "a ", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
179 \ ] |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
180 call s:compare_lines(expect, lines) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
181 call s:close_windows() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
182 endfunc |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
183 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
184 func Test_numberwidth() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
185 call s:test_windows(10, 20) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
186 call setline(1, repeat(['aaaa'], 10)) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
187 setl number numberwidth=6 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
188 let lines = s:screen_lines(1, 3) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
189 let expect = [ |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
190 \ " 1 aa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
191 \ " 2 aa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
192 \ " 3 aa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
193 \ ] |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
194 call s:compare_lines(expect, lines) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
195 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
196 set relativenumber |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
197 let lines = s:screen_lines(1, 3) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
198 let expect = [ |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
199 \ "1 aa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
200 \ " 1 aa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
201 \ " 2 aa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
202 \ ] |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
203 call s:compare_lines(expect, lines) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
204 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
205 set nonumber |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
206 let lines = s:screen_lines(1, 3) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
207 let expect = [ |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
208 \ " 0 aa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
209 \ " 1 aa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
210 \ " 2 aa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
211 \ ] |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
212 call s:compare_lines(expect, lines) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
213 call s:close_windows() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
214 endfunc |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
215 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
216 func Test_numberwidth_adjusted() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
217 call s:test_windows(10, 20) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
218 call setline(1, repeat(['aaaa'], 10000)) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
219 setl number numberwidth=4 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
220 let lines = s:screen_lines(1, 3) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
221 let expect = [ |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
222 \ " 1 aa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
223 \ " 2 aa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
224 \ " 3 aa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
225 \ ] |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
226 call s:compare_lines(expect, lines) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
227 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
228 $ |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
229 let lines = s:screen_lines(8, 10) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
230 let expect = [ |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
231 \ " 9998 aa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
232 \ " 9999 aa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
233 \ "10000 aa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
234 \ ] |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
235 call s:compare_lines(expect, lines) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
236 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
237 setl relativenumber |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
238 let lines = s:screen_lines(8, 10) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
239 let expect = [ |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
240 \ " 2 aa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
241 \ " 1 aa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
242 \ "10000 aa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
243 \ ] |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
244 call s:compare_lines(expect, lines) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
245 |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
246 setl nonumber |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
247 let lines = s:screen_lines(8, 10) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
248 let expect = [ |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
249 \ " 2 aaaa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
250 \ " 1 aaaa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
251 \ " 0 aaaa", |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
252 \ ] |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
253 call s:compare_lines(expect, lines) |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
254 call s:close_windows() |
a479b7064550
patch 8.0.0359: 'number' and 'relativenumber' are not properly tested
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
255 endfunc |
17286
a513b81d3689
patch 8.1.1642: may use uninitialized variable
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
256 |
a513b81d3689
patch 8.1.1642: may use uninitialized variable
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
257 " This was causing a memcheck error |
a513b81d3689
patch 8.1.1642: may use uninitialized variable
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
258 func Test_relativenumber_uninitialised() |
a513b81d3689
patch 8.1.1642: may use uninitialized variable
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
259 new |
a513b81d3689
patch 8.1.1642: may use uninitialized variable
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
260 set rnu |
a513b81d3689
patch 8.1.1642: may use uninitialized variable
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
261 call setline(1, ["a", "b"]) |
a513b81d3689
patch 8.1.1642: may use uninitialized variable
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
262 redraw |
a513b81d3689
patch 8.1.1642: may use uninitialized variable
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
263 call feedkeys("j", 'xt') |
a513b81d3689
patch 8.1.1642: may use uninitialized variable
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
264 redraw |
a513b81d3689
patch 8.1.1642: may use uninitialized variable
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
265 bwipe! |
a513b81d3689
patch 8.1.1642: may use uninitialized variable
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
266 endfunc |
18471
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
267 |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
268 func Test_relativenumber_colors() |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
269 CheckScreendump |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
270 |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
271 let lines =<< trim [CODE] |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
272 call setline(1, range(200)) |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
273 111 |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
274 set number relativenumber |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
275 hi LineNr ctermfg=red |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
276 [CODE] |
30582
72245f9c9405
patch 9.0.0626: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
28224
diff
changeset
|
277 call writefile(lines, 'XTest_relnr', 'D') |
18471
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
278 |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
279 let buf = RunVimInTerminal('-S XTest_relnr', {'rows': 10, 'cols': 50}) |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
280 " Default colors |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
281 call VerifyScreenDump(buf, 'Test_relnr_colors_1', {}) |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
282 |
19495
f6c87afa5501
patch 8.2.0305: relativenumber test fails on some systems
Bram Moolenaar <Bram@vim.org>
parents:
18471
diff
changeset
|
283 call term_sendkeys(buf, ":hi LineNrAbove ctermfg=blue\<CR>:\<CR>") |
18471
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
284 call VerifyScreenDump(buf, 'Test_relnr_colors_2', {}) |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
285 |
19495
f6c87afa5501
patch 8.2.0305: relativenumber test fails on some systems
Bram Moolenaar <Bram@vim.org>
parents:
18471
diff
changeset
|
286 call term_sendkeys(buf, ":hi LineNrBelow ctermfg=green\<CR>:\<CR>") |
18471
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
287 call VerifyScreenDump(buf, 'Test_relnr_colors_3', {}) |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
288 |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
289 call term_sendkeys(buf, ":hi clear LineNrAbove\<CR>") |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
290 call VerifyScreenDump(buf, 'Test_relnr_colors_4', {}) |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
291 |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
292 " clean up |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
293 call StopVimInTerminal(buf) |
b9cf60801963
patch 8.1.2229: cannot color number column above/below cursor differently
Bram Moolenaar <Bram@vim.org>
parents:
17286
diff
changeset
|
294 endfunc |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
295 |
34286
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
296 func Test_relativenumber_colors_wrapped() |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
297 CheckScreendump |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
298 |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
299 let lines =<< trim [CODE] |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
300 set display=lastline scrolloff=0 |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
301 call setline(1, range(200)->map('v:val->string()->repeat(40)')) |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
302 111 |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
303 set number relativenumber |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
304 hi LineNr ctermbg=red ctermfg=black |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
305 hi LineNrAbove ctermbg=blue ctermfg=black |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
306 hi LineNrBelow ctermbg=green ctermfg=black |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
307 [CODE] |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
308 call writefile(lines, 'XTest_relnr_wrap', 'D') |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
309 |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
310 let buf = RunVimInTerminal('-S XTest_relnr_wrap', {'rows': 20, 'cols': 50}) |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
311 |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
312 call VerifyScreenDump(buf, 'Test_relnr_colors_wrapped_1', {}) |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
313 call term_sendkeys(buf, "k") |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
314 call VerifyScreenDump(buf, 'Test_relnr_colors_wrapped_2', {}) |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
315 call term_sendkeys(buf, "2j") |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
316 call VerifyScreenDump(buf, 'Test_relnr_colors_wrapped_3', {}) |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
317 call term_sendkeys(buf, "2j") |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
318 call VerifyScreenDump(buf, 'Test_relnr_colors_wrapped_4', {}) |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
319 call term_sendkeys(buf, "k") |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
320 call VerifyScreenDump(buf, 'Test_relnr_colors_wrapped_5', {}) |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
321 |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
322 " clean up |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
323 call StopVimInTerminal(buf) |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
324 endfunc |
7afcc5481eb7
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines
Christian Brabandt <cb@256bit.org>
parents:
30630
diff
changeset
|
325 |
28224
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
326 func Test_relativenumber_callback() |
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
327 CheckScreendump |
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
328 CheckFeature timers |
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
329 |
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
330 let lines =<< trim END |
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
331 call setline(1, ['aaaaa', 'bbbbb', 'ccccc', 'ddddd']) |
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
332 set relativenumber |
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
333 call cursor(4, 1) |
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
334 |
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
335 func Func(timer) |
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
336 call cursor(1, 1) |
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
337 endfunc |
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
338 |
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
339 call timer_start(300, 'Func') |
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
340 END |
30582
72245f9c9405
patch 9.0.0626: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
28224
diff
changeset
|
341 call writefile(lines, 'Xrnu_timer', 'D') |
28224
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
342 |
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
343 let buf = RunVimInTerminal('-S Xrnu_timer', #{rows: 8}) |
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
344 call TermWait(buf, 310) |
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
345 call VerifyScreenDump(buf, 'Test_relativenumber_callback_1', {}) |
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
346 |
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
347 call StopVimInTerminal(buf) |
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
348 endfunc |
c99005ffa8c3
patch 8.2.4638: superfluous check if a redraw is needed for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25642
diff
changeset
|
349 |
34296
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
350 " Test that line numbers below inserted/deleted lines are updated. |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
351 func Test_number_insert_delete_lines() |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
352 CheckScreendump |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
353 |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
354 let lines =<< trim END |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
355 call setline(1, range(1, 7)) |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
356 set number |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
357 call cursor(2, 1) |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
358 END |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
359 call writefile(lines, 'Xnumber_insert_delete_lines', 'D') |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
360 |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
361 let buf = RunVimInTerminal('-S Xnumber_insert_delete_lines', #{rows: 8}) |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
362 call VerifyScreenDump(buf, 'Test_number_insert_delete_lines_1', {}) |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
363 call term_sendkeys(buf, "dd") |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
364 call VerifyScreenDump(buf, 'Test_number_insert_delete_lines_2', {}) |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
365 call term_sendkeys(buf, "P") |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
366 call VerifyScreenDump(buf, 'Test_number_insert_delete_lines_1', {}) |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
367 call term_sendkeys(buf, "2dd") |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
368 call VerifyScreenDump(buf, 'Test_number_insert_delete_lines_3', {}) |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
369 call term_sendkeys(buf, "P") |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
370 call VerifyScreenDump(buf, 'Test_number_insert_delete_lines_1', {}) |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
371 |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
372 call StopVimInTerminal(buf) |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
373 endfunc |
0690fd6f9d48
patch 9.1.0083: Redrawing can be improved when deleting lines with 'number'
Christian Brabandt <cb@256bit.org>
parents:
34286
diff
changeset
|
374 |
24950
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
375 " Test for displaying line numbers with 'rightleft' |
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
376 func Test_number_rightleft() |
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
377 CheckFeature rightleft |
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
378 new |
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
379 setlocal number |
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
380 setlocal rightleft |
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
381 call setline(1, range(1, 1000)) |
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
382 normal! 9Gzt |
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
383 redraw! |
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
384 call assert_match('^\s\+9 9$', Screenline(1)) |
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
385 normal! 10Gzt |
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
386 redraw! |
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
387 call assert_match('^\s\+01 10$', Screenline(1)) |
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
388 normal! 100Gzt |
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
389 redraw! |
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
390 call assert_match('^\s\+001 100$', Screenline(1)) |
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
391 normal! 1000Gzt |
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
392 redraw! |
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
393 call assert_match('^\s\+0001 1000$', Screenline(1)) |
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
394 bw! |
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
395 endfunc |
18a00b2b9c27
patch 8.2.3012: when 'rightleft' is set the line number is drawn reversed
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
396 |
25642
b46214b82d6e
patch 8.2.3357: crash when 'virtualedit' is set and window is narrow
Bram Moolenaar <Bram@vim.org>
parents:
24950
diff
changeset
|
397 " This used to cause a divide by zero |
b46214b82d6e
patch 8.2.3357: crash when 'virtualedit' is set and window is narrow
Bram Moolenaar <Bram@vim.org>
parents:
24950
diff
changeset
|
398 func Test_number_no_text_virtual_edit() |
b46214b82d6e
patch 8.2.3357: crash when 'virtualedit' is set and window is narrow
Bram Moolenaar <Bram@vim.org>
parents:
24950
diff
changeset
|
399 vnew |
b46214b82d6e
patch 8.2.3357: crash when 'virtualedit' is set and window is narrow
Bram Moolenaar <Bram@vim.org>
parents:
24950
diff
changeset
|
400 call setline(1, ['line one', 'line two']) |
b46214b82d6e
patch 8.2.3357: crash when 'virtualedit' is set and window is narrow
Bram Moolenaar <Bram@vim.org>
parents:
24950
diff
changeset
|
401 set number virtualedit=all |
b46214b82d6e
patch 8.2.3357: crash when 'virtualedit' is set and window is narrow
Bram Moolenaar <Bram@vim.org>
parents:
24950
diff
changeset
|
402 normal w |
b46214b82d6e
patch 8.2.3357: crash when 'virtualedit' is set and window is narrow
Bram Moolenaar <Bram@vim.org>
parents:
24950
diff
changeset
|
403 4wincmd | |
b46214b82d6e
patch 8.2.3357: crash when 'virtualedit' is set and window is narrow
Bram Moolenaar <Bram@vim.org>
parents:
24950
diff
changeset
|
404 normal j |
b46214b82d6e
patch 8.2.3357: crash when 'virtualedit' is set and window is narrow
Bram Moolenaar <Bram@vim.org>
parents:
24950
diff
changeset
|
405 bwipe! |
b46214b82d6e
patch 8.2.3357: crash when 'virtualedit' is set and window is narrow
Bram Moolenaar <Bram@vim.org>
parents:
24950
diff
changeset
|
406 endfunc |
b46214b82d6e
patch 8.2.3357: crash when 'virtualedit' is set and window is narrow
Bram Moolenaar <Bram@vim.org>
parents:
24950
diff
changeset
|
407 |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
408 " vim: shiftwidth=2 sts=2 expandtab |