Mercurial > vim
annotate src/testdir/test_signs.vim @ 16097:d45e42b45470 v8.1.1053
patch 8.1.1053: warning for missing return statement
commit https://github.com/vim/vim/commit/d6c3f1fa2b5e1dd7dc87cf608d72b84ad696b58f
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Mar 26 00:31:21 2019 +0100
patch 8.1.1053: warning for missing return statement
Problem: Warning for missing return statement. (Dominique Pelle)
Solution: Add return statement.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 26 Mar 2019 00:45:05 +0100 |
parents | 9e0154efac3a |
children | 1689b52cf297 |
rev | line source |
---|---|
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Test for signs |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 if !has('signs') |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 finish |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 endif |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 func Test_sign() |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 new |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 call setline(1, ['a', 'b', 'c', 'd']) |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
11 " Define some signs. |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
12 " We can specify icons even if not all versions of vim support icons as |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
13 " icon is ignored when not supported. "(not supported)" is shown after |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
14 " the icon name when listing signs. |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 sign define Sign1 text=x |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
16 try |
15378
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
17 sign define Sign2 text=xy texthl=Title linehl=Error |
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
18 \ icon=../../pixmaps/stock_vim_find_help.png |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
19 catch /E255:/ |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
20 " Ignore error: E255: Couldn't read in sign data! |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
21 " This error can happen when running in the GUI. |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
22 " Some gui like Motif do not support the png icon format. |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
23 endtry |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 " Test listing signs. |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 let a=execute('sign list') |
15378
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
27 call assert_match('^\nsign Sign1 text=x \nsign Sign2 ' . |
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
28 \ 'icon=../../pixmaps/stock_vim_find_help.png .*text=xy ' . |
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
29 \ 'linehl=Error texthl=Title$', a) |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 let a=execute('sign list Sign1') |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 call assert_equal("\nsign Sign1 text=x ", a) |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
34 " Split the window to the bottom to verify sign jump will stay in the |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
35 " current window if the buffer is displayed there. |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
36 let bn = bufnr('%') |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
37 let wn = winnr() |
15343
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
38 exe 'sign place 41 line=3 name=Sign1 buffer=' . bn |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 1 |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
40 bot split |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
41 exe 'sign jump 41 buffer=' . bufnr('%') |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
42 call assert_equal('c', getline('.')) |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
43 call assert_equal(3, winnr()) |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
44 call assert_equal(bn, bufnr('%')) |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
45 call assert_notequal(wn, winnr()) |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
46 |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
47 " Create a new buffer and check that ":sign jump" switches to the old buffer. |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
48 1 |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
49 new foo |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
50 call assert_notequal(bn, bufnr('%')) |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
51 exe 'sign jump 41 buffer=' . bn |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
52 call assert_equal(bn, bufnr('%')) |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
53 call assert_equal('c', getline('.')) |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
54 |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
55 " Redraw to make sure that screen redraw with sign gets exercised, |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
56 " with and without 'rightleft'. |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
57 if has('rightleft') |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
58 set rightleft |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
59 redraw |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
60 set norightleft |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
61 endif |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
62 redraw |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
63 |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
64 " Check that we can't change sign. |
15247
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
65 call assert_fails("sign place 40 name=Sign1 buffer=" . bufnr('%'), 'E885:') |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
66 |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
67 " Check placed signs |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
68 let a=execute('sign place') |
15378
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
69 call assert_equal("\n--- Signs ---\nSigns for [NULL]:\n" . |
15386
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
70 \ " line=3 id=41 name=Sign1 priority=10\n", a) |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
71 |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
72 " Unplace the sign and try jumping to it again should fail. |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
73 sign unplace 41 |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
74 1 |
15247
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
75 call assert_fails("sign jump 41 buffer=" . bufnr('%'), 'E157:') |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
76 call assert_equal('a', getline('.')) |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
77 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
78 " Unplace sign on current line. |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
79 exe 'sign place 42 line=4 name=Sign2 buffer=' . bufnr('%') |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
80 4 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
81 sign unplace |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
82 let a=execute('sign place') |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
83 call assert_equal("\n--- Signs ---\n", a) |
15343
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
84 |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
85 " Try again to unplace sign on current line, it should fail this time. |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
86 call assert_fails('sign unplace', 'E159:') |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
87 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
88 " Unplace all signs. |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
89 exe 'sign place 41 line=3 name=Sign1 buffer=' . bufnr('%') |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
90 sign unplace * |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
91 let a=execute('sign place') |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
92 call assert_equal("\n--- Signs ---\n", a) |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
93 |
15378
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
94 " Place a sign without specifying the filename or buffer |
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
95 sign place 77 line=9 name=Sign2 |
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
96 let a=execute('sign place') |
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
97 call assert_equal("\n--- Signs ---\nSigns for [NULL]:\n" . |
15386
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
98 \ " line=9 id=77 name=Sign2 priority=10\n", a) |
15378
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
99 sign unplace * |
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
100 |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
101 " Check :jump with file=... |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
102 edit foo |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
103 call setline(1, ['A', 'B', 'C', 'D']) |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
104 |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
105 try |
15378
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
106 sign define Sign3 text=y texthl=DoesNotExist linehl=DoesNotExist |
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
107 \ icon=doesnotexist.xpm |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
108 catch /E255:/ |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
109 " ignore error: E255: it can happens for guis. |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
110 endtry |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
111 |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
112 let fn = expand('%:p') |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
113 exe 'sign place 43 line=2 name=Sign3 file=' . fn |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
114 edit bar |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
115 call assert_notequal(fn, expand('%:p')) |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
116 exe 'sign jump 43 file=' . fn |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
117 call assert_equal('B', getline('.')) |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
118 |
15322
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
119 " Check for jumping to a sign in a hidden buffer |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
120 enew! | only! |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
121 edit foo |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
122 call setline(1, ['A', 'B', 'C', 'D']) |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
123 let fn = expand('%:p') |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
124 exe 'sign place 21 line=3 name=Sign3 file=' . fn |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
125 hide edit bar |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
126 exe 'sign jump 21 file=' . fn |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
127 call assert_equal('C', getline('.')) |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
128 |
15156
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
129 " can't define a sign with a non-printable character as text |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
130 call assert_fails("sign define Sign4 text=\e linehl=Comment", 'E239:') |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
131 call assert_fails("sign define Sign4 text=a\e linehl=Comment", 'E239:') |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
132 call assert_fails("sign define Sign4 text=\ea linehl=Comment", 'E239:') |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
133 |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
134 " Only 1 or 2 character text is allowed |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
135 call assert_fails("sign define Sign4 text=abc linehl=Comment", 'E239:') |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
136 call assert_fails("sign define Sign4 text= linehl=Comment", 'E239:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
137 call assert_fails("sign define Sign4 text=\\ ab linehl=Comment", 'E239:') |
15156
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
138 |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
139 " define sign with whitespace |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
140 sign define Sign4 text=\ X linehl=Comment |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
141 sign undefine Sign4 |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
142 sign define Sign4 linehl=Comment text=\ X |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
143 sign undefine Sign4 |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
144 |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
145 sign define Sign5 text=X\ linehl=Comment |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
146 sign undefine Sign5 |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
147 sign define Sign5 linehl=Comment text=X\ |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
148 sign undefine Sign5 |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
149 |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
150 " define sign with backslash |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
151 sign define Sign4 text=\\\\ linehl=Comment |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
152 sign undefine Sign4 |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
153 sign define Sign4 text=\\ linehl=Comment |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
154 sign undefine Sign4 |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
155 |
15322
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
156 " define a sign with a leading 0 in the name |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
157 sign unplace * |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
158 sign define 004 text=#> linehl=Comment |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
159 let a = execute('sign list 4') |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
160 call assert_equal("\nsign 4 text=#> linehl=Comment", a) |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
161 exe 'sign place 20 line=3 name=004 buffer=' . bufnr('') |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
162 let a = execute('sign place') |
15378
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
163 call assert_equal("\n--- Signs ---\nSigns for foo:\n" . |
15386
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
164 \ " line=3 id=20 name=4 priority=10\n", a) |
15322
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
165 exe 'sign unplace 20 buffer=' . bufnr('') |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
166 sign undefine 004 |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
167 call assert_fails('sign list 4', 'E155:') |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
168 |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
169 " After undefining the sign, we should no longer be able to place it. |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
170 sign undefine Sign1 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
171 sign undefine Sign2 |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
172 sign undefine Sign3 |
15247
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
173 call assert_fails("sign place 41 line=3 name=Sign1 buffer=" . |
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
174 \ bufnr('%'), 'E155:') |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
175 endfunc |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
176 |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
177 " Undefining placed sign is not recommended. |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
178 " Quoting :help sign |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
179 " |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
180 " :sign undefine {name} |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
181 " Deletes a previously defined sign. If signs with this {name} |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
182 " are still placed this will cause trouble. |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
183 func Test_sign_undefine_still_placed() |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
184 new foobar |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
185 sign define Sign text=x |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
186 exe 'sign place 41 line=1 name=Sign buffer=' . bufnr('%') |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
187 sign undefine Sign |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
188 |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
189 " Listing placed sign should show that sign is deleted. |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
190 let a=execute('sign place') |
15378
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
191 call assert_equal("\n--- Signs ---\nSigns for foobar:\n" . |
15386
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
192 \ " line=1 id=41 name=[Deleted] priority=10\n", a) |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
193 |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
194 sign unplace 41 |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
195 let a=execute('sign place') |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
196 call assert_equal("\n--- Signs ---\n", a) |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
197 endfunc |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
198 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
199 func Test_sign_completion() |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
200 sign define Sign1 text=x |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
201 sign define Sign2 text=y |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
202 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
203 call feedkeys(":sign \<C-A>\<C-B>\"\<CR>", 'tx') |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
204 call assert_equal('"sign define jump list place undefine unplace', @:) |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
205 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
206 call feedkeys(":sign define Sign \<C-A>\<C-B>\"\<CR>", 'tx') |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
207 call assert_equal('"sign define Sign icon= linehl= text= texthl=', @:) |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
208 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
209 call feedkeys(":sign define Sign linehl=Spell\<C-A>\<C-B>\"\<CR>", 'tx') |
15378
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
210 call assert_equal('"sign define Sign linehl=SpellBad SpellCap ' . |
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
211 \ 'SpellLocal SpellRare', @:) |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
212 |
15864
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
213 call feedkeys(":sign define Sign texthl=Spell\<C-A>\<C-B>\"\<CR>", 'tx') |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
214 call assert_equal('"sign define Sign texthl=SpellBad SpellCap ' . |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
215 \ 'SpellLocal SpellRare', @:) |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
216 |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
217 call writefile(repeat(["Sun is shining"], 30), "XsignOne") |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
218 call writefile(repeat(["Sky is blue"], 30), "XsignTwo") |
10044
46e630ac4380
commit https://github.com/vim/vim/commit/64cefedfc834aa4dac54ae5f91ccbc04e2d56bc5
Christian Brabandt <cb@256bit.org>
parents:
9902
diff
changeset
|
219 call feedkeys(":sign define Sign icon=Xsig\<C-A>\<C-B>\"\<CR>", 'tx') |
46e630ac4380
commit https://github.com/vim/vim/commit/64cefedfc834aa4dac54ae5f91ccbc04e2d56bc5
Christian Brabandt <cb@256bit.org>
parents:
9902
diff
changeset
|
220 call assert_equal('"sign define Sign icon=XsignOne XsignTwo', @:) |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
221 |
15864
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
222 " Test for completion of arguments to ':sign undefine' |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
223 call feedkeys(":sign undefine \<C-A>\<C-B>\"\<CR>", 'tx') |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
224 call assert_equal('"sign undefine Sign1 Sign2', @:) |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
225 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
226 call feedkeys(":sign place 1 \<C-A>\<C-B>\"\<CR>", 'tx') |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
227 call assert_equal('"sign place 1 buffer= file= group= line= name= priority=', |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
228 \ @:) |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
229 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
230 call feedkeys(":sign place 1 name=\<C-A>\<C-B>\"\<CR>", 'tx') |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
231 call assert_equal('"sign place 1 name=Sign1 Sign2', @:) |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
232 |
15864
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
233 edit XsignOne |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
234 sign place 1 name=Sign1 line=5 |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
235 sign place 1 name=Sign1 group=g1 line=10 |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
236 edit XsignTwo |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
237 sign place 1 name=Sign2 group=g2 line=15 |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
238 |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
239 " Test for completion of group= and file= arguments to ':sign place' |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
240 call feedkeys(":sign place 1 name=Sign1 file=Xsign\<C-A>\<C-B>\"\<CR>", 'tx') |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
241 call assert_equal('"sign place 1 name=Sign1 file=XsignOne XsignTwo', @:) |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
242 call feedkeys(":sign place 1 name=Sign1 group=\<C-A>\<C-B>\"\<CR>", 'tx') |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
243 call assert_equal('"sign place 1 name=Sign1 group=g1 g2', @:) |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
244 |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
245 " Test for completion of arguments to 'sign place' without sign identifier |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
246 call feedkeys(":sign place \<C-A>\<C-B>\"\<CR>", 'tx') |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
247 call assert_equal('"sign place buffer= file= group=', @:) |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
248 call feedkeys(":sign place file=Xsign\<C-A>\<C-B>\"\<CR>", 'tx') |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
249 call assert_equal('"sign place file=XsignOne XsignTwo', @:) |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
250 call feedkeys(":sign place group=\<C-A>\<C-B>\"\<CR>", 'tx') |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
251 call assert_equal('"sign place group=g1 g2', @:) |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
252 call feedkeys(":sign place group=g1 file=\<C-A>\<C-B>\"\<CR>", 'tx') |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
253 call assert_equal('"sign place group=g1 file=XsignOne XsignTwo', @:) |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
254 |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
255 " Test for completion of arguments to ':sign unplace' |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
256 call feedkeys(":sign unplace 1 \<C-A>\<C-B>\"\<CR>", 'tx') |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
257 call assert_equal('"sign unplace 1 buffer= file= group=', @:) |
15864
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
258 call feedkeys(":sign unplace 1 file=Xsign\<C-A>\<C-B>\"\<CR>", 'tx') |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
259 call assert_equal('"sign unplace 1 file=XsignOne XsignTwo', @:) |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
260 call feedkeys(":sign unplace 1 group=\<C-A>\<C-B>\"\<CR>", 'tx') |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
261 call assert_equal('"sign unplace 1 group=g1 g2', @:) |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
262 call feedkeys(":sign unplace 1 group=g2 file=Xsign\<C-A>\<C-B>\"\<CR>", 'tx') |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
263 call assert_equal('"sign unplace 1 group=g2 file=XsignOne XsignTwo', @:) |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
264 |
15864
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
265 " Test for completion of arguments to ':sign list' |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
266 call feedkeys(":sign list \<C-A>\<C-B>\"\<CR>", 'tx') |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
267 call assert_equal('"sign list Sign1 Sign2', @:) |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
268 |
15864
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
269 " Test for completion of arguments to ':sign jump' |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
270 call feedkeys(":sign jump 1 \<C-A>\<C-B>\"\<CR>", 'tx') |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
271 call assert_equal('"sign jump 1 buffer= file= group=', @:) |
15864
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
272 call feedkeys(":sign jump 1 file=Xsign\<C-A>\<C-B>\"\<CR>", 'tx') |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
273 call assert_equal('"sign jump 1 file=XsignOne XsignTwo', @:) |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
274 call feedkeys(":sign jump 1 group=\<C-A>\<C-B>\"\<CR>", 'tx') |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
275 call assert_equal('"sign jump 1 group=g1 g2', @:) |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
276 |
15864
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
277 " Error cases |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
278 call feedkeys(":sign here\<C-A>\<C-B>\"\<CR>", 'tx') |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
279 call assert_equal('"sign here', @:) |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
280 call feedkeys(":sign define Sign here=\<C-A>\<C-B>\"\<CR>", 'tx') |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
281 call assert_equal("\"sign define Sign here=\<C-A>", @:) |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
282 call feedkeys(":sign place 1 here=\<C-A>\<C-B>\"\<CR>", 'tx') |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
283 call assert_equal("\"sign place 1 here=\<C-A>", @:) |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
284 call feedkeys(":sign jump 1 here=\<C-A>\<C-B>\"\<CR>", 'tx') |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
285 call assert_equal("\"sign jump 1 here=\<C-A>", @:) |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
286 call feedkeys(":sign here there\<C-A>\<C-B>\"\<CR>", 'tx') |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
287 call assert_equal("\"sign here there\<C-A>", @:) |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
288 call feedkeys(":sign here there=\<C-A>\<C-B>\"\<CR>", 'tx') |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
289 call assert_equal("\"sign here there=\<C-A>", @:) |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
290 |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
291 sign unplace * group=* |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
292 sign undefine Sign1 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
293 sign undefine Sign2 |
15864
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
294 enew |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
295 call delete('XsignOne') |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
296 call delete('XsignTwo') |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
297 endfunc |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
298 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
299 func Test_sign_invalid_commands() |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
300 sign define Sign1 text=x |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
301 |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
302 call assert_fails('sign', 'E471:') |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
303 call assert_fails('sign jump', 'E471:') |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
304 call assert_fails('sign xxx', 'E160:') |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
305 call assert_fails('sign define', 'E156:') |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
306 call assert_fails('sign define Sign1 xxx', 'E475:') |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
307 call assert_fails('sign undefine', 'E156:') |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
308 call assert_fails('sign list xxx', 'E155:') |
12692
03a6aeea2096
patch 8.0.1224: still interference between test functions
Christian Brabandt <cb@256bit.org>
parents:
10044
diff
changeset
|
309 call assert_fails('sign place 1 buffer=999', 'E158:') |
15322
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
310 call assert_fails('sign place 1 name=Sign1 buffer=999', 'E158:') |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
311 call assert_fails('sign place buffer=999', 'E158:') |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
312 call assert_fails('sign jump buffer=999', 'E158:') |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
313 call assert_fails('sign jump 1 file=', 'E158:') |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
314 call assert_fails('sign jump 1 group=', 'E474:') |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
315 call assert_fails('sign jump 1 name=', 'E474:') |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
316 call assert_fails('sign jump 1 name=Sign1', 'E474:') |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
317 call assert_fails('sign jump 1 line=100', '474:') |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
318 call assert_fails('sign define Sign2 text=', 'E239:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
319 " Non-numeric identifier for :sign place |
15378
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
320 call assert_fails("sign place abc line=3 name=Sign1 buffer=" . bufnr(''), |
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
321 \ 'E474:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
322 " Non-numeric identifier for :sign unplace |
15378
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
323 call assert_fails("sign unplace abc name=Sign1 buffer=" . bufnr(''), |
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
324 \ 'E474:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
325 " Number followed by an alphabet as sign identifier for :sign place |
15378
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
326 call assert_fails("sign place 1abc line=3 name=Sign1 buffer=" . bufnr(''), |
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
327 \ 'E474:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
328 " Number followed by an alphabet as sign identifier for :sign unplace |
15378
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
329 call assert_fails("sign unplace 2abc name=Sign1 buffer=" . bufnr(''), |
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
330 \ 'E474:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
331 " Sign identifier and '*' for :sign unplace |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
332 call assert_fails("sign unplace 2 *", 'E474:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
333 " Trailing characters after buffer number for :sign place |
15378
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
334 call assert_fails("sign place 1 line=3 name=Sign1 buffer=" . |
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
335 \ bufnr('%') . 'xxx', 'E488:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
336 " Trailing characters after buffer number for :sign unplace |
15247
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
337 call assert_fails("sign unplace 1 buffer=" . bufnr('%') . 'xxx', 'E488:') |
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
338 call assert_fails("sign unplace * buffer=" . bufnr('%') . 'xxx', 'E488:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
339 call assert_fails("sign unplace 1 xxx", 'E474:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
340 call assert_fails("sign unplace * xxx", 'E474:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
341 call assert_fails("sign unplace xxx", 'E474:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
342 " Placing a sign without line number |
15247
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
343 call assert_fails("sign place name=Sign1 buffer=" . bufnr('%'), 'E474:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
344 " Placing a sign without sign name |
15247
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
345 call assert_fails("sign place line=10 buffer=" . bufnr('%'), 'E474:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
346 " Unplacing a sign with line number |
15247
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
347 call assert_fails("sign unplace 2 line=10 buffer=" . bufnr('%'), 'E474:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
348 " Unplacing a sign with sign name |
15247
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
349 call assert_fails("sign unplace 2 name=Sign1 buffer=" . bufnr('%'), 'E474:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
350 " Placing a sign without sign name |
15247
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
351 call assert_fails("sign place 2 line=3 buffer=" . bufnr('%'), 'E474:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
352 " Placing a sign with only sign identifier |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
353 call assert_fails("sign place 2", 'E474:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
354 " Placing a sign with only a name |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
355 call assert_fails("sign place abc", 'E474:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
356 " Placing a sign with only line number |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
357 call assert_fails("sign place 5 line=3", 'E474:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
358 " Placing a sign with only sign group |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
359 call assert_fails("sign place 5 group=g1", 'E474:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
360 call assert_fails("sign place 5 group=*", 'E474:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
361 " Placing a sign with only sign priority |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
362 call assert_fails("sign place 5 priority=10", 'E474:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
363 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
364 sign undefine Sign1 |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
365 endfunc |
9902
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
366 |
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
367 func Test_sign_delete_buffer() |
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
368 new |
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
369 sign define Sign text=x |
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
370 let bufnr = bufnr('%') |
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
371 new |
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
372 exe 'bd ' . bufnr |
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
373 exe 'sign place 61 line=3 name=Sign buffer=' . bufnr |
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
374 call assert_fails('sign jump 61 buffer=' . bufnr, 'E934:') |
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
375 sign unplace 61 |
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
376 sign undefine Sign |
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
377 endfunc |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
378 |
15271
a6319aca721b
patch 8.1.0644: finding next sign ID is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15247
diff
changeset
|
379 " Test for Vim script functions for managing signs |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
380 func Test_sign_funcs() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
381 " Remove all the signs |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
382 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
383 call sign_undefine() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
384 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
385 " Tests for sign_define() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
386 let attr = {'text' : '=>', 'linehl' : 'Search', 'texthl' : 'Error'} |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
387 call assert_equal(0, sign_define("sign1", attr)) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
388 call assert_equal([{'name' : 'sign1', 'texthl' : 'Error', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
389 \ 'linehl' : 'Search', 'text' : '=>'}], sign_getdefined()) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
390 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
391 " Define a new sign without attributes and then update it |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
392 call sign_define("sign2") |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
393 let attr = {'text' : '!!', 'linehl' : 'DiffAdd', 'texthl' : 'DiffChange', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
394 \ 'icon' : 'sign2.ico'} |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
395 try |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
396 call sign_define("sign2", attr) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
397 catch /E255:/ |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
398 " ignore error: E255: Couldn't read in sign data! |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
399 " This error can happen when running in gui. |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
400 endtry |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
401 call assert_equal([{'name' : 'sign2', 'texthl' : 'DiffChange', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
402 \ 'linehl' : 'DiffAdd', 'text' : '!!', 'icon' : 'sign2.ico'}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
403 \ sign_getdefined("sign2")) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
404 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
405 " Test for a sign name with digits |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
406 call assert_equal(0, sign_define(0002, {'linehl' : 'StatusLine'})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
407 call assert_equal([{'name' : '2', 'linehl' : 'StatusLine'}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
408 \ sign_getdefined(0002)) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
409 call sign_undefine(0002) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
410 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
411 " Tests for invalid arguments to sign_define() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
412 call assert_fails('call sign_define("sign4", {"text" : "===>"})', 'E239:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
413 call assert_fails('call sign_define("sign5", {"text" : ""})', 'E239:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
414 call assert_fails('call sign_define([])', 'E730:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
415 call assert_fails('call sign_define("sign6", [])', 'E715:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
416 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
417 " Tests for sign_getdefined() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
418 call assert_equal([], sign_getdefined("none")) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
419 call assert_fails('call sign_getdefined({})', 'E731:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
420 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
421 " Tests for sign_place() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
422 call writefile(repeat(["Sun is shining"], 30), "Xsign") |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
423 edit Xsign |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
424 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
425 call assert_equal(10, sign_place(10, '', 'sign1', 'Xsign', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
426 \ {'lnum' : 20})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
427 call assert_equal([{'bufnr' : bufnr(''), 'signs' : |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
428 \ [{'id' : 10, 'group' : '', 'lnum' : 20, 'name' : 'sign1', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
429 \ 'priority' : 10}]}], sign_getplaced('Xsign')) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
430 call assert_equal([{'bufnr' : bufnr(''), 'signs' : |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
431 \ [{'id' : 10, 'group' : '', 'lnum' : 20, 'name' : 'sign1', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
432 \ 'priority' : 10}]}], |
15343
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
433 \ sign_getplaced('%', {'lnum' : 20})) |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
434 call assert_equal([{'bufnr' : bufnr(''), 'signs' : |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
435 \ [{'id' : 10, 'group' : '', 'lnum' : 20, 'name' : 'sign1', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
436 \ 'priority' : 10}]}], |
15343
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
437 \ sign_getplaced('', {'id' : 10})) |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
438 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
439 " Tests for invalid arguments to sign_place() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
440 call assert_fails('call sign_place([], "", "mySign", 1)', 'E745:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
441 call assert_fails('call sign_place(5, "", "mySign", -1)', 'E158:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
442 call assert_fails('call sign_place(-1, "", "sign1", "Xsign", [])', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
443 \ 'E474:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
444 call assert_fails('call sign_place(-1, "", "sign1", "Xsign", |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
445 \ {"lnum" : 30})', 'E474:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
446 call assert_fails('call sign_place(10, "", "xsign1x", "Xsign", |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
447 \ {"lnum" : 30})', 'E155:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
448 call assert_fails('call sign_place(10, "", "", "Xsign", |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
449 \ {"lnum" : 30})', 'E155:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
450 call assert_fails('call sign_place(10, "", [], "Xsign", |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
451 \ {"lnum" : 30})', 'E730:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
452 call assert_fails('call sign_place(5, "", "sign1", "abcxyz.xxx", |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
453 \ {"lnum" : 10})', 'E158:') |
15343
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
454 call assert_fails('call sign_place(5, "", "sign1", "@", {"lnum" : 10})', |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
455 \ 'E158:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
456 call assert_fails('call sign_place(5, "", "sign1", [], {"lnum" : 10})', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
457 \ 'E158:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
458 call assert_fails('call sign_place(21, "", "sign1", "Xsign", |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
459 \ {"lnum" : -1})', 'E885:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
460 call assert_fails('call sign_place(22, "", "sign1", "Xsign", |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
461 \ {"lnum" : 0})', 'E885:') |
15304
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
462 call assert_fails('call sign_place(22, "", "sign1", "Xsign", |
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
463 \ {"lnum" : []})', 'E745:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
464 call assert_equal(-1, sign_place(1, "*", "sign1", "Xsign", {"lnum" : 10})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
465 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
466 " Tests for sign_getplaced() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
467 call assert_equal([{'bufnr' : bufnr(''), 'signs' : |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
468 \ [{'id' : 10, 'group' : '', 'lnum' : 20, 'name' : 'sign1', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
469 \ 'priority' : 10}]}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
470 \ sign_getplaced(bufnr('Xsign'))) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
471 call assert_equal([{'bufnr' : bufnr(''), 'signs' : |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
472 \ [{'id' : 10, 'group' : '', 'lnum' : 20, 'name' : 'sign1', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
473 \ 'priority' : 10}]}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
474 \ sign_getplaced()) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
475 call assert_fails("call sign_getplaced('dummy.sign')", 'E158:') |
15343
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
476 call assert_fails('call sign_getplaced("&")', 'E158:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
477 call assert_fails('call sign_getplaced(-1)', 'E158:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
478 call assert_fails('call sign_getplaced("Xsign", [])', 'E715:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
479 call assert_equal([{'bufnr' : bufnr(''), 'signs' : []}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
480 \ sign_getplaced('Xsign', {'lnum' : 1000000})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
481 call assert_fails("call sign_getplaced('Xsign', {'lnum' : []})", |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
482 \ 'E745:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
483 call assert_equal([{'bufnr' : bufnr(''), 'signs' : []}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
484 \ sign_getplaced('Xsign', {'id' : 44})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
485 call assert_fails("call sign_getplaced('Xsign', {'id' : []})", |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
486 \ 'E745:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
487 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
488 " Tests for sign_unplace() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
489 call sign_place(20, '', 'sign2', 'Xsign', {"lnum" : 30}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
490 call assert_equal(0, sign_unplace('', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
491 \ {'id' : 20, 'buffer' : 'Xsign'})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
492 call assert_equal(-1, sign_unplace('', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
493 \ {'id' : 30, 'buffer' : 'Xsign'})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
494 call sign_place(20, '', 'sign2', 'Xsign', {"lnum" : 30}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
495 call assert_fails("call sign_unplace('', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
496 \ {'id' : 20, 'buffer' : 'buffer.c'})", 'E158:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
497 call assert_fails("call sign_unplace('', |
15343
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
498 \ {'id' : 20, 'buffer' : '&'})", 'E158:') |
15304
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
499 call assert_fails("call sign_unplace('g1', |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
500 \ {'id' : 20, 'buffer' : 200})", 'E158:') |
15304
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
501 call assert_fails("call sign_unplace('g1', 'mySign')", 'E715:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
502 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
503 " Tests for sign_undefine() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
504 call assert_equal(0, sign_undefine("sign1")) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
505 call assert_equal([], sign_getdefined("sign1")) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
506 call assert_fails('call sign_undefine("none")', 'E155:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
507 call assert_fails('call sign_undefine([])', 'E730:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
508 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
509 call delete("Xsign") |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
510 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
511 call sign_undefine() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
512 enew | only |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
513 endfunc |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
514 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
515 " Tests for sign groups |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
516 func Test_sign_group() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
517 enew | only |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
518 " Remove all the signs |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
519 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
520 call sign_undefine() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
521 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
522 call writefile(repeat(["Sun is shining"], 30), "Xsign") |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
523 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
524 let attr = {'text' : '=>', 'linehl' : 'Search', 'texthl' : 'Error'} |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
525 call assert_equal(0, sign_define("sign1", attr)) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
526 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
527 edit Xsign |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
528 let bnum = bufnr('%') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
529 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
530 " Error case |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
531 call assert_fails("call sign_place(5, [], 'sign1', 'Xsign', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
532 \ {'lnum' : 30})", 'E730:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
533 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
534 " place three signs with the same identifier. One in the global group and |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
535 " others in the named groups |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
536 call assert_equal(5, sign_place(5, '', 'sign1', 'Xsign', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
537 \ {'lnum' : 10})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
538 call assert_equal(5, sign_place(5, 'g1', 'sign1', bnum, {'lnum' : 20})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
539 call assert_equal(5, sign_place(5, 'g2', 'sign1', bnum, {'lnum' : 30})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
540 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
541 " Test for sign_getplaced() with group |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
542 let s = sign_getplaced('Xsign') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
543 call assert_equal(1, len(s[0].signs)) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
544 call assert_equal(s[0].signs[0].group, '') |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
545 let s = sign_getplaced(bnum, {'group' : ''}) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
546 call assert_equal([{'id' : 5, 'group' : '', 'name' : 'sign1', 'lnum' : 10, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
547 \ 'priority' : 10}], s[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
548 call assert_equal(1, len(s[0].signs)) |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
549 let s = sign_getplaced(bnum, {'group' : 'g2'}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
550 call assert_equal('g2', s[0].signs[0].group) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
551 let s = sign_getplaced(bnum, {'group' : 'g3'}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
552 call assert_equal([], s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
553 let s = sign_getplaced(bnum, {'group' : '*'}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
554 call assert_equal([{'id' : 5, 'group' : '', 'name' : 'sign1', 'lnum' : 10, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
555 \ 'priority' : 10}, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
556 \ {'id' : 5, 'group' : 'g1', 'name' : 'sign1', 'lnum' : 20, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
557 \ 'priority' : 10}, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
558 \ {'id' : 5, 'group' : 'g2', 'name' : 'sign1', 'lnum' : 30, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
559 \ 'priority' : 10}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
560 \ s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
561 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
562 " Test for sign_getplaced() with id |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
563 let s = sign_getplaced(bnum, {'id' : 5}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
564 call assert_equal([{'id' : 5, 'group' : '', 'name' : 'sign1', 'lnum' : 10, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
565 \ 'priority' : 10}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
566 \ s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
567 let s = sign_getplaced(bnum, {'id' : 5, 'group' : 'g2'}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
568 call assert_equal( |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
569 \ [{'id' : 5, 'name' : 'sign1', 'lnum' : 30, 'group' : 'g2', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
570 \ 'priority' : 10}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
571 \ s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
572 let s = sign_getplaced(bnum, {'id' : 5, 'group' : '*'}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
573 call assert_equal([{'id' : 5, 'group' : '', 'name' : 'sign1', 'lnum' : 10, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
574 \ 'priority' : 10}, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
575 \ {'id' : 5, 'group' : 'g1', 'name' : 'sign1', 'lnum' : 20, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
576 \ 'priority' : 10}, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
577 \ {'id' : 5, 'group' : 'g2', 'name' : 'sign1', 'lnum' : 30, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
578 \ 'priority' : 10}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
579 \ s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
580 let s = sign_getplaced(bnum, {'id' : 5, 'group' : 'g3'}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
581 call assert_equal([], s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
582 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
583 " Test for sign_getplaced() with lnum |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
584 let s = sign_getplaced(bnum, {'lnum' : 20}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
585 call assert_equal([], s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
586 let s = sign_getplaced(bnum, {'lnum' : 20, 'group' : 'g1'}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
587 call assert_equal( |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
588 \ [{'id' : 5, 'name' : 'sign1', 'lnum' : 20, 'group' : 'g1', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
589 \ 'priority' : 10}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
590 \ s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
591 let s = sign_getplaced(bnum, {'lnum' : 30, 'group' : '*'}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
592 call assert_equal( |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
593 \ [{'id' : 5, 'name' : 'sign1', 'lnum' : 30, 'group' : 'g2', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
594 \ 'priority' : 10}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
595 \ s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
596 let s = sign_getplaced(bnum, {'lnum' : 40, 'group' : '*'}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
597 call assert_equal([], s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
598 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
599 " Error case |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
600 call assert_fails("call sign_getplaced(bnum, {'group' : []})", |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
601 \ 'E730:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
602 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
603 " Clear the sign in global group |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
604 call sign_unplace('', {'id' : 5, 'buffer' : bnum}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
605 let s = sign_getplaced(bnum, {'group' : '*'}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
606 call assert_equal([ |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
607 \ {'id' : 5, 'name' : 'sign1', 'lnum' : 20, 'group' : 'g1', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
608 \ 'priority' : 10}, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
609 \ {'id' : 5, 'name' : 'sign1', 'lnum' : 30, 'group' : 'g2', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
610 \ 'priority' : 10}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
611 \ s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
612 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
613 " Clear the sign in one of the groups |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
614 call sign_unplace('g1', {'buffer' : 'Xsign'}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
615 let s = sign_getplaced(bnum, {'group' : '*'}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
616 call assert_equal([ |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
617 \ {'id' : 5, 'name' : 'sign1', 'lnum' : 30, 'group' : 'g2', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
618 \ 'priority' : 10}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
619 \ s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
620 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
621 " Clear all the signs from the buffer |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
622 call sign_unplace('*', {'buffer' : bnum}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
623 call assert_equal([], sign_getplaced(bnum, {'group' : '*'})[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
624 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
625 " Clear sign across groups using an identifier |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
626 call sign_place(25, '', 'sign1', bnum, {'lnum' : 10}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
627 call sign_place(25, 'g1', 'sign1', bnum, {'lnum' : 11}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
628 call sign_place(25, 'g2', 'sign1', bnum, {'lnum' : 12}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
629 call assert_equal(0, sign_unplace('*', {'id' : 25})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
630 call assert_equal([], sign_getplaced(bnum, {'group' : '*'})[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
631 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
632 " Error case |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
633 call assert_fails("call sign_unplace([])", 'E474:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
634 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
635 " Place a sign in the global group and try to delete it using a group |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
636 call assert_equal(5, sign_place(5, '', 'sign1', bnum, {'lnum' : 10})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
637 call assert_equal(-1, sign_unplace('g1', {'id' : 5})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
638 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
639 " Place signs in multiple groups and delete all the signs in one of the |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
640 " group |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
641 call assert_equal(5, sign_place(5, '', 'sign1', bnum, {'lnum' : 10})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
642 call assert_equal(6, sign_place(6, '', 'sign1', bnum, {'lnum' : 11})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
643 call assert_equal(5, sign_place(5, 'g1', 'sign1', bnum, {'lnum' : 10})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
644 call assert_equal(5, sign_place(5, 'g2', 'sign1', bnum, {'lnum' : 10})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
645 call assert_equal(6, sign_place(6, 'g1', 'sign1', bnum, {'lnum' : 11})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
646 call assert_equal(6, sign_place(6, 'g2', 'sign1', bnum, {'lnum' : 11})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
647 call assert_equal(0, sign_unplace('g1')) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
648 let s = sign_getplaced(bnum, {'group' : 'g1'}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
649 call assert_equal([], s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
650 let s = sign_getplaced(bnum) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
651 call assert_equal(2, len(s[0].signs)) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
652 let s = sign_getplaced(bnum, {'group' : 'g2'}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
653 call assert_equal('g2', s[0].signs[0].group) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
654 call assert_equal(0, sign_unplace('', {'id' : 5})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
655 call assert_equal(0, sign_unplace('', {'id' : 6})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
656 let s = sign_getplaced(bnum, {'group' : 'g2'}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
657 call assert_equal('g2', s[0].signs[0].group) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
658 call assert_equal(0, sign_unplace('', {'buffer' : bnum})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
659 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
660 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
661 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
662 " Test for :sign command and groups |
15247
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
663 sign place 5 line=10 name=sign1 file=Xsign |
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
664 sign place 5 group=g1 line=10 name=sign1 file=Xsign |
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
665 sign place 5 group=g2 line=10 name=sign1 file=Xsign |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
666 |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
667 " Tests for the ':sign place' command |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
668 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
669 " :sign place file={fname} |
15247
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
670 let a = execute('sign place file=Xsign') |
15378
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
671 call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" . |
15386
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
672 \ " line=10 id=5 name=sign1 priority=10\n", a) |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
673 |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
674 " :sign place group={group} file={fname} |
15247
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
675 let a = execute('sign place group=g2 file=Xsign') |
15378
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
676 call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" . |
15386
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
677 \ " line=10 id=5 group=g2 name=sign1 priority=10\n", a) |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
678 |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
679 " :sign place group=* file={fname} |
15247
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
680 let a = execute('sign place group=* file=Xsign') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
681 call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" . |
15386
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
682 \ " line=10 id=5 group=g2 name=sign1 priority=10\n" . |
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
683 \ " line=10 id=5 group=g1 name=sign1 priority=10\n" . |
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
684 \ " line=10 id=5 name=sign1 priority=10\n", a) |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
685 |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
686 " Error case: non-existing group |
15247
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
687 let a = execute('sign place group=xyz file=Xsign') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
688 call assert_equal("\n--- Signs ---\nSigns for Xsign:\n", a) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
689 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
690 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
691 let bnum = bufnr('Xsign') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
692 exe 'sign place 5 line=10 name=sign1 buffer=' . bnum |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
693 exe 'sign place 5 group=g1 line=11 name=sign1 buffer=' . bnum |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
694 exe 'sign place 5 group=g2 line=12 name=sign1 buffer=' . bnum |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
695 |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
696 " :sign place buffer={fname} |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
697 let a = execute('sign place buffer=' . bnum) |
15378
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
698 call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" . |
15386
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
699 \ " line=10 id=5 name=sign1 priority=10\n", a) |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
700 |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
701 " :sign place group={group} buffer={fname} |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
702 let a = execute('sign place group=g2 buffer=' . bnum) |
15378
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
703 call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" . |
15386
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
704 \ " line=12 id=5 group=g2 name=sign1 priority=10\n", a) |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
705 |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
706 " :sign place group=* buffer={fname} |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
707 let a = execute('sign place group=* buffer=' . bnum) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
708 call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" . |
15386
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
709 \ " line=10 id=5 name=sign1 priority=10\n" . |
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
710 \ " line=11 id=5 group=g1 name=sign1 priority=10\n" . |
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
711 \ " line=12 id=5 group=g2 name=sign1 priority=10\n", a) |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
712 |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
713 " Error case: non-existing group |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
714 let a = execute('sign place group=xyz buffer=' . bnum) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
715 call assert_equal("\n--- Signs ---\nSigns for Xsign:\n", a) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
716 |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
717 " :sign place |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
718 let a = execute('sign place') |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
719 call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" . |
15386
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
720 \ " line=10 id=5 name=sign1 priority=10\n", a) |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
721 |
15388
7444fffa482d
patch 8.1.0702: ":sign place" only uses the current buffer
Bram Moolenaar <Bram@vim.org>
parents:
15386
diff
changeset
|
722 " Place signs in more than one buffer and list the signs |
7444fffa482d
patch 8.1.0702: ":sign place" only uses the current buffer
Bram Moolenaar <Bram@vim.org>
parents:
15386
diff
changeset
|
723 split foo |
7444fffa482d
patch 8.1.0702: ":sign place" only uses the current buffer
Bram Moolenaar <Bram@vim.org>
parents:
15386
diff
changeset
|
724 set buftype=nofile |
7444fffa482d
patch 8.1.0702: ":sign place" only uses the current buffer
Bram Moolenaar <Bram@vim.org>
parents:
15386
diff
changeset
|
725 sign place 25 line=76 name=sign1 priority=99 file=foo |
7444fffa482d
patch 8.1.0702: ":sign place" only uses the current buffer
Bram Moolenaar <Bram@vim.org>
parents:
15386
diff
changeset
|
726 let a = execute('sign place') |
7444fffa482d
patch 8.1.0702: ":sign place" only uses the current buffer
Bram Moolenaar <Bram@vim.org>
parents:
15386
diff
changeset
|
727 call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" . |
7444fffa482d
patch 8.1.0702: ":sign place" only uses the current buffer
Bram Moolenaar <Bram@vim.org>
parents:
15386
diff
changeset
|
728 \ " line=10 id=5 name=sign1 priority=10\n" . |
7444fffa482d
patch 8.1.0702: ":sign place" only uses the current buffer
Bram Moolenaar <Bram@vim.org>
parents:
15386
diff
changeset
|
729 \ "Signs for foo:\n" . |
7444fffa482d
patch 8.1.0702: ":sign place" only uses the current buffer
Bram Moolenaar <Bram@vim.org>
parents:
15386
diff
changeset
|
730 \ " line=76 id=25 name=sign1 priority=99\n", a) |
7444fffa482d
patch 8.1.0702: ":sign place" only uses the current buffer
Bram Moolenaar <Bram@vim.org>
parents:
15386
diff
changeset
|
731 close |
7444fffa482d
patch 8.1.0702: ":sign place" only uses the current buffer
Bram Moolenaar <Bram@vim.org>
parents:
15386
diff
changeset
|
732 bwipe foo |
7444fffa482d
patch 8.1.0702: ":sign place" only uses the current buffer
Bram Moolenaar <Bram@vim.org>
parents:
15386
diff
changeset
|
733 |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
734 " :sign place group={group} |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
735 let a = execute('sign place group=g1') |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
736 call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" . |
15386
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
737 \ " line=11 id=5 group=g1 name=sign1 priority=10\n", a) |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
738 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
739 " :sign place group=* |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
740 let a = execute('sign place group=*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
741 call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" . |
15386
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
742 \ " line=10 id=5 name=sign1 priority=10\n" . |
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
743 \ " line=11 id=5 group=g1 name=sign1 priority=10\n" . |
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
744 \ " line=12 id=5 group=g2 name=sign1 priority=10\n", a) |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
745 |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
746 " Test for ':sign jump' command with groups |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
747 sign jump 5 group=g1 file=Xsign |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
748 call assert_equal(11, line('.')) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
749 call assert_equal('Xsign', bufname('')) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
750 sign jump 5 group=g2 file=Xsign |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
751 call assert_equal(12, line('.')) |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
752 |
15378
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
753 " Test for :sign jump command without the filename or buffer |
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
754 sign jump 5 |
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
755 call assert_equal(10, line('.')) |
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
756 sign jump 5 group=g1 |
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
757 call assert_equal(11, line('.')) |
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
758 |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
759 " Error cases |
15247
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
760 call assert_fails("sign place 3 group= name=sign1 buffer=" . bnum, 'E474:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
761 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
762 call delete("Xsign") |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
763 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
764 call sign_undefine() |
15304
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
765 enew | only |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
766 endfunc |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
767 |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
768 " Place signs used for ":sign unplace" command test |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
769 func Place_signs_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
770 call sign_unplace('*') |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
771 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
772 sign place 3 line=10 name=sign1 file=Xsign1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
773 sign place 3 group=g1 line=11 name=sign1 file=Xsign1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
774 sign place 3 group=g2 line=12 name=sign1 file=Xsign1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
775 sign place 4 line=15 name=sign1 file=Xsign1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
776 sign place 4 group=g1 line=16 name=sign1 file=Xsign1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
777 sign place 4 group=g2 line=17 name=sign1 file=Xsign1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
778 sign place 5 line=20 name=sign1 file=Xsign2 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
779 sign place 5 group=g1 line=21 name=sign1 file=Xsign2 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
780 sign place 5 group=g2 line=22 name=sign1 file=Xsign2 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
781 sign place 6 line=25 name=sign1 file=Xsign2 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
782 sign place 6 group=g1 line=26 name=sign1 file=Xsign2 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
783 sign place 6 group=g2 line=27 name=sign1 file=Xsign2 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
784 endfunc |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
785 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
786 " Place multiple signs in a single line for test |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
787 func Place_signs_at_line_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
788 call sign_unplace('*') |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
789 sign place 3 line=13 name=sign1 file=Xsign1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
790 sign place 3 group=g1 line=13 name=sign1 file=Xsign1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
791 sign place 3 group=g2 line=13 name=sign1 file=Xsign1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
792 sign place 4 line=13 name=sign1 file=Xsign1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
793 sign place 4 group=g1 line=13 name=sign1 file=Xsign1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
794 sign place 4 group=g2 line=13 name=sign1 file=Xsign1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
795 endfunc |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
796 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
797 " Tests for the ':sign unplace' command |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
798 func Test_sign_unplace() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
799 enew | only |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
800 " Remove all the signs |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
801 call sign_unplace('*') |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
802 call sign_undefine() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
803 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
804 " Create two files and define signs |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
805 call writefile(repeat(["Sun is shining"], 30), "Xsign1") |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
806 call writefile(repeat(["It is beautiful"], 30), "Xsign2") |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
807 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
808 let attr = {'text' : '=>', 'linehl' : 'Search', 'texthl' : 'Error'} |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
809 call sign_define("sign1", attr) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
810 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
811 edit Xsign1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
812 let bnum1 = bufnr('%') |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
813 split Xsign2 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
814 let bnum2 = bufnr('%') |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
815 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
816 let signs1 = [{'id' : 3, 'name' : 'sign1', 'lnum' : 10, 'group' : '', |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
817 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
818 \ {'id' : 3, 'name' : 'sign1', 'lnum' : 11, 'group' : 'g1', |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
819 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
820 \ {'id' : 3, 'name' : 'sign1', 'lnum' : 12, 'group' : 'g2', |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
821 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
822 \ {'id' : 4, 'name' : 'sign1', 'lnum' : 15, 'group' : '', |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
823 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
824 \ {'id' : 4, 'name' : 'sign1', 'lnum' : 16, 'group' : 'g1', |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
825 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
826 \ {'id' : 4, 'name' : 'sign1', 'lnum' : 17, 'group' : 'g2', |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
827 \ 'priority' : 10},] |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
828 let signs2 = [{'id' : 5, 'name' : 'sign1', 'lnum' : 20, 'group' : '', |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
829 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
830 \ {'id' : 5, 'name' : 'sign1', 'lnum' : 21, 'group' : 'g1', |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
831 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
832 \ {'id' : 5, 'name' : 'sign1', 'lnum' : 22, 'group' : 'g2', |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
833 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
834 \ {'id' : 6, 'name' : 'sign1', 'lnum' : 25, 'group' : '', |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
835 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
836 \ {'id' : 6, 'name' : 'sign1', 'lnum' : 26, 'group' : 'g1', |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
837 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
838 \ {'id' : 6, 'name' : 'sign1', 'lnum' : 27, 'group' : 'g2', |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
839 \ 'priority' : 10},] |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
840 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
841 " Test for :sign unplace {id} file={fname} |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
842 call Place_signs_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
843 sign unplace 3 file=Xsign1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
844 sign unplace 6 file=Xsign2 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
845 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
846 \ filter(copy(signs1), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
847 \ {idx, val -> val.id != 3 || val.group != ''}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
848 \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
849 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
850 \ filter(copy(signs2), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
851 \ {idx, val -> val.id != 6 || val.group != ''}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
852 \ sign_getplaced('Xsign2', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
853 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
854 " Test for :sign unplace {id} group={group} file={fname} |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
855 call Place_signs_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
856 sign unplace 4 group=g1 file=Xsign1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
857 sign unplace 5 group=g2 file=Xsign2 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
858 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
859 \ filter(copy(signs1), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
860 \ {idx, val -> val.id != 4 || val.group != 'g1'}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
861 \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
862 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
863 \ filter(copy(signs2), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
864 \ {idx, val -> val.id != 5 || val.group != 'g2'}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
865 \ sign_getplaced('Xsign2', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
866 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
867 " Test for :sign unplace {id} group=* file={fname} |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
868 call Place_signs_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
869 sign unplace 3 group=* file=Xsign1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
870 sign unplace 6 group=* file=Xsign2 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
871 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
872 \ filter(copy(signs1), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
873 \ {idx, val -> val.id != 3}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
874 \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
875 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
876 \ filter(copy(signs2), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
877 \ {idx, val -> val.id != 6}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
878 \ sign_getplaced('Xsign2', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
879 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
880 " Test for :sign unplace * file={fname} |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
881 call Place_signs_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
882 sign unplace * file=Xsign1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
883 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
884 \ filter(copy(signs1), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
885 \ {idx, val -> val.group != ''}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
886 \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
887 call assert_equal(signs2, sign_getplaced('Xsign2', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
888 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
889 " Test for :sign unplace * group={group} file={fname} |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
890 call Place_signs_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
891 sign unplace * group=g1 file=Xsign1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
892 sign unplace * group=g2 file=Xsign2 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
893 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
894 \ filter(copy(signs1), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
895 \ {idx, val -> val.group != 'g1'}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
896 \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
897 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
898 \ filter(copy(signs2), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
899 \ {idx, val -> val.group != 'g2'}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
900 \ sign_getplaced('Xsign2', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
901 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
902 " Test for :sign unplace * group=* file={fname} |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
903 call Place_signs_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
904 sign unplace * group=* file=Xsign2 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
905 call assert_equal(signs1, sign_getplaced('Xsign1', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
906 call assert_equal([], sign_getplaced('Xsign2', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
907 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
908 " Test for :sign unplace {id} buffer={nr} |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
909 call Place_signs_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
910 exe 'sign unplace 3 buffer=' . bnum1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
911 exe 'sign unplace 6 buffer=' . bnum2 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
912 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
913 \ filter(copy(signs1), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
914 \ {idx, val -> val.id != 3 || val.group != ''}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
915 \ sign_getplaced(bnum1, {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
916 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
917 \ filter(copy(signs2), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
918 \ {idx, val -> val.id != 6 || val.group != ''}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
919 \ sign_getplaced(bnum2, {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
920 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
921 " Test for :sign unplace {id} group={group} buffer={nr} |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
922 call Place_signs_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
923 exe 'sign unplace 4 group=g1 buffer=' . bnum1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
924 exe 'sign unplace 5 group=g2 buffer=' . bnum2 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
925 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
926 \ filter(copy(signs1), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
927 \ {idx, val -> val.id != 4 || val.group != 'g1'}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
928 \ sign_getplaced(bnum1, {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
929 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
930 \ filter(copy(signs2), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
931 \ {idx, val -> val.id != 5 || val.group != 'g2'}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
932 \ sign_getplaced(bnum2, {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
933 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
934 " Test for :sign unplace {id} group=* buffer={nr} |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
935 call Place_signs_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
936 exe 'sign unplace 3 group=* buffer=' . bnum1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
937 exe 'sign unplace 6 group=* buffer=' . bnum2 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
938 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
939 \ filter(copy(signs1), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
940 \ {idx, val -> val.id != 3}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
941 \ sign_getplaced(bnum1, {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
942 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
943 \ filter(copy(signs2), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
944 \ {idx, val -> val.id != 6}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
945 \ sign_getplaced(bnum2, {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
946 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
947 " Test for :sign unplace * buffer={nr} |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
948 call Place_signs_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
949 exe 'sign unplace * buffer=' . bnum1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
950 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
951 \ filter(copy(signs1), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
952 \ {idx, val -> val.group != ''}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
953 \ sign_getplaced(bnum1, {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
954 call assert_equal(signs2, sign_getplaced(bnum2, {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
955 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
956 " Test for :sign unplace * group={group} buffer={nr} |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
957 call Place_signs_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
958 exe 'sign unplace * group=g1 buffer=' . bnum1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
959 exe 'sign unplace * group=g2 buffer=' . bnum2 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
960 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
961 \ filter(copy(signs1), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
962 \ {idx, val -> val.group != 'g1'}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
963 \ sign_getplaced(bnum1, {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
964 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
965 \ filter(copy(signs2), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
966 \ {idx, val -> val.group != 'g2'}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
967 \ sign_getplaced(bnum2, {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
968 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
969 " Test for :sign unplace * group=* buffer={nr} |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
970 call Place_signs_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
971 exe 'sign unplace * group=* buffer=' . bnum2 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
972 call assert_equal(signs1, sign_getplaced(bnum1, {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
973 call assert_equal([], sign_getplaced(bnum2, {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
974 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
975 " Test for :sign unplace {id} |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
976 call Place_signs_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
977 sign unplace 4 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
978 sign unplace 6 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
979 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
980 \ filter(copy(signs1), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
981 \ {idx, val -> val.id != 4 || val.group != ''}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
982 \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
983 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
984 \ filter(copy(signs2), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
985 \ {idx, val -> val.id != 6 || val.group != ''}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
986 \ sign_getplaced('Xsign2', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
987 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
988 " Test for :sign unplace {id} group={group} |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
989 call Place_signs_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
990 sign unplace 4 group=g1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
991 sign unplace 6 group=g2 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
992 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
993 \ filter(copy(signs1), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
994 \ {idx, val -> val.id != 4 || val.group != 'g1'}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
995 \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
996 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
997 \ filter(copy(signs2), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
998 \ {idx, val -> val.id != 6 || val.group != 'g2'}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
999 \ sign_getplaced('Xsign2', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1000 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1001 " Test for :sign unplace {id} group=* |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1002 call Place_signs_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1003 sign unplace 3 group=* |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1004 sign unplace 5 group=* |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1005 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1006 \ filter(copy(signs1), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1007 \ {idx, val -> val.id != 3}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1008 \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1009 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1010 \ filter(copy(signs2), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1011 \ {idx, val -> val.id != 5}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1012 \ sign_getplaced('Xsign2', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1013 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1014 " Test for :sign unplace * |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1015 call Place_signs_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1016 sign unplace * |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1017 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1018 \ filter(copy(signs1), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1019 \ {idx, val -> val.group != ''}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1020 \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1021 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1022 \ filter(copy(signs2), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1023 \ {idx, val -> val.group != ''}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1024 \ sign_getplaced('Xsign2', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1025 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1026 " Test for :sign unplace * group={group} |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1027 call Place_signs_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1028 sign unplace * group=g1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1029 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1030 \ filter(copy(signs1), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1031 \ {idx, val -> val.group != 'g1'}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1032 \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1033 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1034 \ filter(copy(signs2), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1035 \ {idx, val -> val.group != 'g1'}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1036 \ sign_getplaced('Xsign2', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1037 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1038 " Test for :sign unplace * group=* |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1039 call Place_signs_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1040 sign unplace * group=* |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1041 call assert_equal([], sign_getplaced('Xsign1', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1042 call assert_equal([], sign_getplaced('Xsign2', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1043 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1044 " Negative test cases |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1045 call Place_signs_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1046 sign unplace 3 group=xy file=Xsign1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1047 sign unplace * group=xy file=Xsign1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1048 silent! sign unplace * group=* file=FileNotPresent |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1049 call assert_equal(signs1, sign_getplaced('Xsign1', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1050 call assert_equal(signs2, sign_getplaced('Xsign2', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1051 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1052 " Tests for removing sign at the current cursor position |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1053 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1054 " Test for ':sign unplace' |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1055 let signs1 = [{'id' : 4, 'name' : 'sign1', 'lnum' : 13, 'group' : 'g2', |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1056 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1057 \ {'id' : 4, 'name' : 'sign1', 'lnum' : 13, 'group' : 'g1', |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1058 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1059 \ {'id' : 4, 'name' : 'sign1', 'lnum' : 13, 'group' : '', |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1060 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1061 \ {'id' : 3, 'name' : 'sign1', 'lnum' : 13, 'group' : 'g2', |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1062 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1063 \ {'id' : 3, 'name' : 'sign1', 'lnum' : 13, 'group' : 'g1', |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1064 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1065 \ {'id' : 3, 'name' : 'sign1', 'lnum' : 13, 'group' : '', |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1066 \ 'priority' : 10},] |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1067 exe bufwinnr('Xsign1') . 'wincmd w' |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1068 call cursor(13, 1) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1069 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1070 " Should remove only one sign in the global group |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1071 call Place_signs_at_line_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1072 sign unplace |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1073 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1074 \ filter(copy(signs1), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1075 \ {idx, val -> val.id != 4 || val.group != ''}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1076 \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1077 " Should remove the second sign in the global group |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1078 sign unplace |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1079 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1080 \ filter(copy(signs1), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1081 \ {idx, val -> val.group != ''}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1082 \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1083 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1084 " Test for ':sign unplace group={group}' |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1085 call Place_signs_at_line_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1086 " Should remove only one sign in group g1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1087 sign unplace group=g1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1088 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1089 \ filter(copy(signs1), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1090 \ {idx, val -> val.id != 4 || val.group != 'g1'}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1091 \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1092 sign unplace group=g2 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1093 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1094 \ filter(copy(signs1), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1095 \ {idx, val -> val.id != 4 || val.group == ''}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1096 \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1097 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1098 " Test for ':sign unplace group=*' |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1099 call Place_signs_at_line_for_test() |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1100 sign unplace group=* |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1101 sign unplace group=* |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1102 sign unplace group=* |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1103 call assert_equal( |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1104 \ filter(copy(signs1), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1105 \ {idx, val -> val.id != 4}), |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1106 \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1107 sign unplace group=* |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1108 sign unplace group=* |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1109 sign unplace group=* |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1110 call assert_equal([], sign_getplaced('Xsign1', {'group' : '*'})[0].signs) |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1111 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1112 call sign_unplace('*') |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1113 call sign_undefine() |
15304
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
1114 enew | only |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1115 call delete("Xsign1") |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1116 call delete("Xsign2") |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1117 endfunc |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1118 |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1119 " Tests for auto-generating the sign identifier |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1120 func Test_sign_id_autogen() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1121 enew | only |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1122 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1123 call sign_undefine() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1124 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1125 let attr = {'text' : '=>', 'linehl' : 'Search', 'texthl' : 'Error'} |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1126 call assert_equal(0, sign_define("sign1", attr)) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1127 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1128 call writefile(repeat(["Sun is shining"], 30), "Xsign") |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1129 edit Xsign |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1130 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1131 call assert_equal(1, sign_place(0, '', 'sign1', 'Xsign', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1132 \ {'lnum' : 10})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1133 call assert_equal(2, sign_place(2, '', 'sign1', 'Xsign', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1134 \ {'lnum' : 12})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1135 call assert_equal(3, sign_place(0, '', 'sign1', 'Xsign', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1136 \ {'lnum' : 14})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1137 call sign_unplace('', {'buffer' : 'Xsign', 'id' : 2}) |
15271
a6319aca721b
patch 8.1.0644: finding next sign ID is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15247
diff
changeset
|
1138 call assert_equal(4, sign_place(0, '', 'sign1', 'Xsign', |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1139 \ {'lnum' : 12})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1140 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1141 call assert_equal(1, sign_place(0, 'g1', 'sign1', 'Xsign', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1142 \ {'lnum' : 11})) |
15304
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
1143 " Check for the next generated sign id in this group |
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
1144 call assert_equal(2, sign_place(0, 'g1', 'sign1', 'Xsign', |
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
1145 \ {'lnum' : 12})) |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1146 call assert_equal(0, sign_unplace('g1', {'id' : 1})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1147 call assert_equal(10, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1148 \ sign_getplaced('Xsign', {'id' : 1})[0].signs[0].lnum) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1149 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1150 call delete("Xsign") |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1151 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1152 call sign_undefine() |
15304
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
1153 enew | only |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1154 endfunc |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1155 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1156 " Test for sign priority |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1157 func Test_sign_priority() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1158 enew | only |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1159 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1160 call sign_undefine() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1161 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1162 let attr = {'text' : '=>', 'linehl' : 'Search', 'texthl' : 'Search'} |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1163 call sign_define("sign1", attr) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1164 call sign_define("sign2", attr) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1165 call sign_define("sign3", attr) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1166 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1167 " Place three signs with different priority in the same line |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1168 call writefile(repeat(["Sun is shining"], 30), "Xsign") |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1169 edit Xsign |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1170 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1171 call sign_place(1, 'g1', 'sign1', 'Xsign', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1172 \ {'lnum' : 11, 'priority' : 50}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1173 call sign_place(2, 'g2', 'sign2', 'Xsign', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1174 \ {'lnum' : 11, 'priority' : 100}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1175 call sign_place(3, '', 'sign3', 'Xsign', {'lnum' : 11}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1176 let s = sign_getplaced('Xsign', {'group' : '*'}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1177 call assert_equal([ |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1178 \ {'id' : 2, 'name' : 'sign2', 'lnum' : 11, 'group' : 'g2', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1179 \ 'priority' : 100}, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1180 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 11, 'group' : 'g1', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1181 \ 'priority' : 50}, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1182 \ {'id' : 3, 'name' : 'sign3', 'lnum' : 11, 'group' : '', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1183 \ 'priority' : 10}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1184 \ s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1185 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1186 " Error case |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1187 call assert_fails("call sign_place(1, 'g1', 'sign1', 'Xsign', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1188 \ [])", 'E715:') |
15304
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
1189 call assert_fails("call sign_place(1, 'g1', 'sign1', 'Xsign', |
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
1190 \ {'priority' : []})", 'E745:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1191 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1192 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1193 " Tests for the :sign place command with priority |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1194 sign place 5 line=10 name=sign1 priority=30 file=Xsign |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1195 sign place 5 group=g1 line=10 name=sign1 priority=20 file=Xsign |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1196 sign place 5 group=g2 line=10 name=sign1 priority=25 file=Xsign |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1197 let a = execute('sign place group=*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1198 call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" . |
15386
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
1199 \ " line=10 id=5 name=sign1 priority=30\n" . |
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
1200 \ " line=10 id=5 group=g2 name=sign1 priority=25\n" . |
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
1201 \ " line=10 id=5 group=g1 name=sign1 priority=20\n", a) |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1202 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1203 " Test for :sign place group={group} |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1204 let a = execute('sign place group=g1') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1205 call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" . |
15386
317846db300a
patch 8.1.0701: sign message not translated and inconsistent spacing
Bram Moolenaar <Bram@vim.org>
parents:
15378
diff
changeset
|
1206 \ " line=10 id=5 group=g1 name=sign1 priority=20\n", a) |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1207 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1208 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1209 call sign_undefine() |
15304
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
1210 enew | only |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1211 call delete("Xsign") |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1212 endfunc |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1213 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1214 " Tests for memory allocation failures in sign functions |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1215 func Test_sign_memfailures() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1216 call writefile(repeat(["Sun is shining"], 30), "Xsign") |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1217 edit Xsign |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1218 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1219 call test_alloc_fail(GetAllocId('sign_getdefined'), 0, 0) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1220 call assert_fails('call sign_getdefined("sign1")', 'E342:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1221 call test_alloc_fail(GetAllocId('sign_getplaced'), 0, 0) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1222 call assert_fails('call sign_getplaced("Xsign")', 'E342:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1223 call test_alloc_fail(GetAllocId('sign_define_by_name'), 0, 0) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1224 let attr = {'text' : '=>', 'linehl' : 'Search', 'texthl' : 'Error'} |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1225 call assert_fails('call sign_define("sign1", attr)', 'E342:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1226 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1227 let attr = {'text' : '=>', 'linehl' : 'Search', 'texthl' : 'Error'} |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1228 call sign_define("sign1", attr) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1229 call test_alloc_fail(GetAllocId('sign_getlist'), 0, 0) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1230 call assert_fails('call sign_getdefined("sign1")', 'E342:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1231 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1232 call sign_place(3, 'g1', 'sign1', 'Xsign', {'lnum' : 10}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1233 call test_alloc_fail(GetAllocId('sign_getplaced_dict'), 0, 0) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1234 call assert_fails('call sign_getplaced("Xsign")', 'E342:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1235 call test_alloc_fail(GetAllocId('sign_getplaced_list'), 0, 0) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1236 call assert_fails('call sign_getplaced("Xsign")', 'E342:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1237 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1238 call test_alloc_fail(GetAllocId('insert_sign'), 0, 0) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1239 call assert_fails('call sign_place(4, "g1", "sign1", "Xsign", {"lnum" : 11})', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1240 \ 'E342:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1241 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1242 call test_alloc_fail(GetAllocId('sign_getinfo'), 0, 0) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1243 call assert_fails('call getbufinfo()', 'E342:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1244 call sign_place(4, 'g1', 'sign1', 'Xsign', {'lnum' : 11}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1245 call test_alloc_fail(GetAllocId('sign_getinfo'), 0, 0) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1246 call assert_fails('let binfo=getbufinfo("Xsign")', 'E342:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1247 call assert_equal([{'lnum': 11, 'id': 4, 'name': 'sign1', |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1248 \ 'priority': 10, 'group': 'g1'}], binfo[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1249 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1250 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1251 call sign_undefine() |
15304
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
1252 enew | only |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1253 call delete("Xsign") |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1254 endfunc |
15343
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1255 |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1256 " Test for auto-adjusting the line number of a placed sign. |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1257 func Test_sign_lnum_adjust() |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1258 enew! | only! |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1259 |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1260 sign define sign1 text=#> linehl=Comment |
15519
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1261 call setline(1, ['A', 'B', 'C', 'D', 'E']) |
15343
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1262 exe 'sign place 5 line=3 name=sign1 buffer=' . bufnr('') |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1263 let l = sign_getplaced(bufnr('')) |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1264 call assert_equal(3, l[0].signs[0].lnum) |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1265 |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1266 " Add some lines before the sign and check the sign line number |
15519
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1267 call append(2, ['BA', 'BB', 'BC']) |
15343
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1268 let l = sign_getplaced(bufnr('')) |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1269 call assert_equal(6, l[0].signs[0].lnum) |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1270 |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1271 " Delete some lines before the sign and check the sign line number |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1272 call deletebufline('%', 1, 2) |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1273 let l = sign_getplaced(bufnr('')) |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1274 call assert_equal(4, l[0].signs[0].lnum) |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1275 |
15519
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1276 " Insert some lines after the sign and check the sign line number |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1277 call append(5, ['DA', 'DB']) |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1278 let l = sign_getplaced(bufnr('')) |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1279 call assert_equal(4, l[0].signs[0].lnum) |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1280 |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1281 " Delete some lines after the sign and check the sign line number |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1282 call deletebufline('', 6, 7) |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1283 let l = sign_getplaced(bufnr('')) |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1284 call assert_equal(4, l[0].signs[0].lnum) |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1285 |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1286 " Break the undo. Otherwise the undo operation below will undo all the |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1287 " changes made by this function. |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1288 let &undolevels=&undolevels |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1289 |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1290 " Delete the line with the sign |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1291 call deletebufline('', 4) |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1292 let l = sign_getplaced(bufnr('')) |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1293 call assert_equal(4, l[0].signs[0].lnum) |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1294 |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1295 " Undo the delete operation |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1296 undo |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1297 let l = sign_getplaced(bufnr('')) |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1298 call assert_equal(5, l[0].signs[0].lnum) |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1299 |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1300 " Break the undo |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1301 let &undolevels=&undolevels |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1302 |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1303 " Delete few lines at the end of the buffer including the line with the sign |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1304 " Sign line number should not change (as it is placed outside of the buffer) |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1305 call deletebufline('', 3, 6) |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1306 let l = sign_getplaced(bufnr('')) |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1307 call assert_equal(5, l[0].signs[0].lnum) |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1308 |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1309 " Undo the delete operation. Sign should be restored to the previous line |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1310 undo |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1311 let l = sign_getplaced(bufnr('')) |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1312 call assert_equal(5, l[0].signs[0].lnum) |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1313 |
15343
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1314 sign unplace * group=* |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1315 sign undefine sign1 |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1316 enew! |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1317 endfunc |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1318 |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1319 " Test for changing the type of a placed sign |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1320 func Test_sign_change_type() |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1321 enew! | only! |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1322 |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1323 sign define sign1 text=#> linehl=Comment |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1324 sign define sign2 text=@@ linehl=Comment |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1325 |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1326 call setline(1, ['A', 'B', 'C', 'D']) |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1327 exe 'sign place 4 line=3 name=sign1 buffer=' . bufnr('') |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1328 let l = sign_getplaced(bufnr('')) |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1329 call assert_equal('sign1', l[0].signs[0].name) |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1330 exe 'sign place 4 name=sign2 buffer=' . bufnr('') |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1331 let l = sign_getplaced(bufnr('')) |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1332 call assert_equal('sign2', l[0].signs[0].name) |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1333 call sign_place(4, '', 'sign1', '') |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1334 let l = sign_getplaced(bufnr('')) |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1335 call assert_equal('sign1', l[0].signs[0].name) |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1336 |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1337 exe 'sign place 4 group=g1 line=4 name=sign1 buffer=' . bufnr('') |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1338 let l = sign_getplaced(bufnr(''), {'group' : 'g1'}) |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1339 call assert_equal('sign1', l[0].signs[0].name) |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1340 exe 'sign place 4 group=g1 name=sign2 buffer=' . bufnr('') |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1341 let l = sign_getplaced(bufnr(''), {'group' : 'g1'}) |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1342 call assert_equal('sign2', l[0].signs[0].name) |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1343 call sign_place(4, 'g1', 'sign1', '') |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1344 let l = sign_getplaced(bufnr(''), {'group' : 'g1'}) |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1345 call assert_equal('sign1', l[0].signs[0].name) |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1346 |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1347 sign unplace * group=* |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1348 sign undefine sign1 |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1349 sign undefine sign2 |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1350 enew! |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1351 endfunc |
15418
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1352 |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1353 " Test for the sign_jump() function |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1354 func Test_sign_jump_func() |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1355 enew! | only! |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1356 |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1357 sign define sign1 text=#> linehl=Comment |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1358 |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1359 edit foo |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1360 set buftype=nofile |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1361 call setline(1, ['A', 'B', 'C', 'D', 'E']) |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1362 call sign_place(5, '', 'sign1', '', {'lnum' : 2}) |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1363 call sign_place(5, 'g1', 'sign1', '', {'lnum' : 3}) |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1364 call sign_place(6, '', 'sign1', '', {'lnum' : 4}) |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1365 call sign_place(6, 'g1', 'sign1', '', {'lnum' : 5}) |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1366 split bar |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1367 set buftype=nofile |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1368 call setline(1, ['P', 'Q', 'R', 'S', 'T']) |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1369 call sign_place(5, '', 'sign1', '', {'lnum' : 2}) |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1370 call sign_place(5, 'g1', 'sign1', '', {'lnum' : 3}) |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1371 call sign_place(6, '', 'sign1', '', {'lnum' : 4}) |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1372 call sign_place(6, 'g1', 'sign1', '', {'lnum' : 5}) |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1373 |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1374 let r = sign_jump(5, '', 'foo') |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1375 call assert_equal(2, r) |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1376 call assert_equal(2, line('.')) |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1377 let r = sign_jump(6, 'g1', 'foo') |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1378 call assert_equal(5, r) |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1379 call assert_equal(5, line('.')) |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1380 let r = sign_jump(5, '', 'bar') |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1381 call assert_equal(2, r) |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1382 call assert_equal(2, line('.')) |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1383 |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1384 " Error cases |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1385 call assert_fails("call sign_jump(99, '', 'bar')", 'E157:') |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1386 call assert_fails("call sign_jump(0, '', 'foo')", 'E474:') |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1387 call assert_fails("call sign_jump(5, 'g5', 'foo')", 'E157:') |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1388 call assert_fails('call sign_jump([], "", "foo")', 'E745:') |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1389 call assert_fails('call sign_jump(2, [], "foo")', 'E730:') |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1390 call assert_fails('call sign_jump(2, "", {})', 'E158:') |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1391 call assert_fails('call sign_jump(2, "", "baz")', 'E158:') |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1392 |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1393 sign unplace * group=* |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1394 sign undefine sign1 |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1395 enew! | only! |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1396 endfunc |