Mercurial > vim
annotate src/testdir/test_signs.vim @ 33988:7c30841c60a0 v9.0.2180
patch 9.0.2180: POSIX function name in exarg causes issues
Commit: https://github.com/vim/vim/commit/6fdb6280821a822768df5689a5d727e37d38306c
Author: Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
Date: Tue Dec 19 20:53:07 2023 +0100
patch 9.0.2180: POSIX function name in exarg causes issues
Problem: POSIX function name in exarg struct causes issues
on OpenVMS
Solution: Rename getline member in exarg struct to ea_getline,
remove isinf() workaround for VMS
There are compilers that do not treat well POSIX functions - like
getline - usage in the structs.
Older VMS compilers could digest this... but the newer OpenVMS compilers
( like VSI C x86-64 X7.4-843 (GEM 50XB9) ) cannot deal with these
structs. This could be limited to getline() that is defined via
getdelim() and might not affect all POSIX functions in general - but
avoiding POSIX function names usage in the structs is a "safe side"
practice without compromising the functionality or the code readability.
The previous OpenVMS X86 port used a workaround limiting the compiler
capabilities using __CRTL_VER_OVERRIDE=80400000
In order to make the OpenVMS port future proof, this pull request
proposes a possible solution.
closes: #13704
Signed-off-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 19 Dec 2023 21:00:04 +0100 |
parents | 4af3b4cd8d2e |
children | fff85588c140 |
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 |
17089
8e9e9124c7a2
patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
17049
diff
changeset
|
3 source check.vim |
8e9e9124c7a2
patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
17049
diff
changeset
|
4 CheckFeature signs |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 |
17105
811c5c2f5236
patch 8.1.1552: cursor position is wrong after sign column changes
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
6 source screendump.vim |
811c5c2f5236
patch 8.1.1552: cursor position is wrong after sign column changes
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
7 |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 func Test_sign() |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 new |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 call setline(1, ['a', 'b', 'c', 'd']) |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
12 " Define some signs. |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
13 " 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
|
14 " 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
|
15 " the icon name when listing signs. |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 sign define Sign1 text=x |
17807
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
17 |
26690
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
18 call Sign_command_ignore_error('sign define Sign2 text=xy texthl=Title linehl=Error culhl=Search numhl=Number icon=../../pixmaps/stock_vim_find_help.png') |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 " Test listing signs. |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 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
|
22 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
|
23 \ 'icon=../../pixmaps/stock_vim_find_help.png .*text=xy ' . |
26690
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
24 \ 'linehl=Error texthl=Title culhl=Search numhl=Number$', a) |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 let a=execute('sign list Sign1') |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 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
|
28 |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
29 " 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
|
30 " 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
|
31 let bn = bufnr('%') |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
32 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
|
33 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
|
34 1 |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
35 bot split |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
36 exe 'sign jump 41 buffer=' . bufnr('%') |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
37 call assert_equal('c', getline('.')) |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
38 call assert_equal(3, winnr()) |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
39 call assert_equal(bn, bufnr('%')) |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
40 call assert_notequal(wn, winnr()) |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
41 |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
42 " 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
|
43 1 |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
44 new foo |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
45 call assert_notequal(bn, bufnr('%')) |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
46 exe 'sign jump 41 buffer=' . bn |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
47 call assert_equal(bn, bufnr('%')) |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
48 call assert_equal('c', getline('.')) |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
49 |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
50 " 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
|
51 " with and without 'rightleft'. |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
52 if has('rightleft') |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
53 set rightleft |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
54 redraw |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
55 set norightleft |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
56 endif |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
57 redraw |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
58 |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
59 " 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
|
60 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
|
61 |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
62 " Check placed signs |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
63 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
|
64 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
|
65 \ " 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
|
66 |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
67 " 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
|
68 sign unplace 41 |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
69 1 |
15247
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
70 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
|
71 call assert_equal('a', getline('.')) |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
72 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
73 " Unplace sign on current line. |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
74 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
|
75 4 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
76 sign unplace |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
77 let a=execute('sign place') |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
78 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
|
79 |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
80 " 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
|
81 call assert_fails('sign unplace', 'E159:') |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
82 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
83 " Unplace all signs. |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
84 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
|
85 sign unplace * |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
86 let a=execute('sign place') |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
87 call assert_equal("\n--- Signs ---\n", a) |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
88 |
15378
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
89 " 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
|
90 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
|
91 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
|
92 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
|
93 \ " 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
|
94 sign unplace * |
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
95 |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
96 " Check :jump with file=... |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
97 edit foo |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
98 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
|
99 |
17807
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
100 call Sign_command_ignore_error('sign define Sign3 text=y texthl=DoesNotExist linehl=DoesNotExist icon=doesnotexist.xpm') |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
101 |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
102 let fn = expand('%:p') |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
103 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
|
104 edit bar |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
105 call assert_notequal(fn, expand('%:p')) |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
106 exe 'sign jump 43 file=' . fn |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
107 call assert_equal('B', getline('.')) |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
108 |
15322
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
109 " 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
|
110 enew! | only! |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
111 edit foo |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
112 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
|
113 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
|
114 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
|
115 hide edit bar |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
116 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
|
117 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
|
118 |
15156
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
119 " 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
|
120 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
|
121 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
|
122 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
|
123 |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
124 " 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
|
125 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
|
126 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
|
127 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
|
128 |
26432
99a512bd8423
patch 8.2.3747: cannot remove highlight from an existing sign
Bram Moolenaar <Bram@vim.org>
parents:
26424
diff
changeset
|
129 " an empty highlight argument for an existing sign clears it |
26690
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
130 sign define SignY texthl=TextHl culhl=CulHl linehl=LineHl numhl=NumHl |
26432
99a512bd8423
patch 8.2.3747: cannot remove highlight from an existing sign
Bram Moolenaar <Bram@vim.org>
parents:
26424
diff
changeset
|
131 let sl = sign_getdefined('SignY')[0] |
99a512bd8423
patch 8.2.3747: cannot remove highlight from an existing sign
Bram Moolenaar <Bram@vim.org>
parents:
26424
diff
changeset
|
132 call assert_equal('TextHl', sl.texthl) |
99a512bd8423
patch 8.2.3747: cannot remove highlight from an existing sign
Bram Moolenaar <Bram@vim.org>
parents:
26424
diff
changeset
|
133 call assert_equal('CulHl', sl.culhl) |
99a512bd8423
patch 8.2.3747: cannot remove highlight from an existing sign
Bram Moolenaar <Bram@vim.org>
parents:
26424
diff
changeset
|
134 call assert_equal('LineHl', sl.linehl) |
26690
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
135 call assert_equal('NumHl', sl.numhl) |
26432
99a512bd8423
patch 8.2.3747: cannot remove highlight from an existing sign
Bram Moolenaar <Bram@vim.org>
parents:
26424
diff
changeset
|
136 |
26690
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
137 sign define SignY texthl= culhl=CulHl linehl=LineHl numhl=NumHl |
26432
99a512bd8423
patch 8.2.3747: cannot remove highlight from an existing sign
Bram Moolenaar <Bram@vim.org>
parents:
26424
diff
changeset
|
138 let sl = sign_getdefined('SignY')[0] |
99a512bd8423
patch 8.2.3747: cannot remove highlight from an existing sign
Bram Moolenaar <Bram@vim.org>
parents:
26424
diff
changeset
|
139 call assert_false(has_key(sl, 'texthl')) |
99a512bd8423
patch 8.2.3747: cannot remove highlight from an existing sign
Bram Moolenaar <Bram@vim.org>
parents:
26424
diff
changeset
|
140 call assert_equal('CulHl', sl.culhl) |
99a512bd8423
patch 8.2.3747: cannot remove highlight from an existing sign
Bram Moolenaar <Bram@vim.org>
parents:
26424
diff
changeset
|
141 call assert_equal('LineHl', sl.linehl) |
26690
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
142 call assert_equal('NumHl', sl.numhl) |
26432
99a512bd8423
patch 8.2.3747: cannot remove highlight from an existing sign
Bram Moolenaar <Bram@vim.org>
parents:
26424
diff
changeset
|
143 |
99a512bd8423
patch 8.2.3747: cannot remove highlight from an existing sign
Bram Moolenaar <Bram@vim.org>
parents:
26424
diff
changeset
|
144 sign define SignY linehl= |
99a512bd8423
patch 8.2.3747: cannot remove highlight from an existing sign
Bram Moolenaar <Bram@vim.org>
parents:
26424
diff
changeset
|
145 let sl = sign_getdefined('SignY')[0] |
99a512bd8423
patch 8.2.3747: cannot remove highlight from an existing sign
Bram Moolenaar <Bram@vim.org>
parents:
26424
diff
changeset
|
146 call assert_false(has_key(sl, 'linehl')) |
99a512bd8423
patch 8.2.3747: cannot remove highlight from an existing sign
Bram Moolenaar <Bram@vim.org>
parents:
26424
diff
changeset
|
147 call assert_equal('CulHl', sl.culhl) |
26690
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
148 call assert_equal('NumHl', sl.numhl) |
26432
99a512bd8423
patch 8.2.3747: cannot remove highlight from an existing sign
Bram Moolenaar <Bram@vim.org>
parents:
26424
diff
changeset
|
149 |
99a512bd8423
patch 8.2.3747: cannot remove highlight from an existing sign
Bram Moolenaar <Bram@vim.org>
parents:
26424
diff
changeset
|
150 sign define SignY culhl= |
99a512bd8423
patch 8.2.3747: cannot remove highlight from an existing sign
Bram Moolenaar <Bram@vim.org>
parents:
26424
diff
changeset
|
151 let sl = sign_getdefined('SignY')[0] |
99a512bd8423
patch 8.2.3747: cannot remove highlight from an existing sign
Bram Moolenaar <Bram@vim.org>
parents:
26424
diff
changeset
|
152 call assert_false(has_key(sl, 'culhl')) |
26690
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
153 call assert_equal('NumHl', sl.numhl) |
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
154 |
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
155 sign define SignY numhl= |
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
156 let sl = sign_getdefined('SignY')[0] |
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
157 call assert_false(has_key(sl, 'numhl')) |
26432
99a512bd8423
patch 8.2.3747: cannot remove highlight from an existing sign
Bram Moolenaar <Bram@vim.org>
parents:
26424
diff
changeset
|
158 |
99a512bd8423
patch 8.2.3747: cannot remove highlight from an existing sign
Bram Moolenaar <Bram@vim.org>
parents:
26424
diff
changeset
|
159 sign undefine SignY |
26424
f6ca4276c4cc
patch 8.2.3743: ":sign" can add a highlight group without a name
Bram Moolenaar <Bram@vim.org>
parents:
26266
diff
changeset
|
160 |
15156
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
161 " 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
|
162 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
|
163 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
|
164 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
|
165 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
|
166 |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
167 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
|
168 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
|
169 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
|
170 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
|
171 |
b63787182765
patch 8.1.0588: cannot define a sign with space in the text
Bram Moolenaar <Bram@vim.org>
parents:
12692
diff
changeset
|
172 " 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
|
173 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
|
174 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
|
175 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
|
176 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
|
177 |
15322
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
178 " 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
|
179 sign unplace * |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
180 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
|
181 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
|
182 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
|
183 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
|
184 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
|
185 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
|
186 \ " 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
|
187 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
|
188 sign undefine 004 |
c6c306c5027f
patch 8.1.0669: the ex_sign() function is too long
Bram Moolenaar <Bram@vim.org>
parents:
15304
diff
changeset
|
189 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
|
190 |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
191 " 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
|
192 sign undefine Sign1 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
193 sign undefine Sign2 |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
194 sign undefine Sign3 |
15247
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
195 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
|
196 \ bufnr('%'), 'E155:') |
33795
4af3b4cd8d2e
patch 9.0.2116: No test for defining sign without attribute
Christian Brabandt <cb@256bit.org>
parents:
32721
diff
changeset
|
197 |
4af3b4cd8d2e
patch 9.0.2116: No test for defining sign without attribute
Christian Brabandt <cb@256bit.org>
parents:
32721
diff
changeset
|
198 " Defining a sign without attributes is allowed. |
4af3b4cd8d2e
patch 9.0.2116: No test for defining sign without attribute
Christian Brabandt <cb@256bit.org>
parents:
32721
diff
changeset
|
199 sign define Sign1 |
4af3b4cd8d2e
patch 9.0.2116: No test for defining sign without attribute
Christian Brabandt <cb@256bit.org>
parents:
32721
diff
changeset
|
200 call assert_equal([{'name': 'Sign1'}], sign_getdefined()) |
4af3b4cd8d2e
patch 9.0.2116: No test for defining sign without attribute
Christian Brabandt <cb@256bit.org>
parents:
32721
diff
changeset
|
201 sign undefine Sign1 |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
202 endfunc |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
203 |
30383
9126e872893d
patch 9.0.0527: long sign text may overflow buffer
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
204 func Test_sign_many_bytes() |
9126e872893d
patch 9.0.0527: long sign text may overflow buffer
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
205 new |
9126e872893d
patch 9.0.0527: long sign text may overflow buffer
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
206 set signcolumn=number |
9126e872893d
patch 9.0.0527: long sign text may overflow buffer
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
207 set number |
9126e872893d
patch 9.0.0527: long sign text may overflow buffer
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
208 call setline(1, 'some text') |
9126e872893d
patch 9.0.0527: long sign text may overflow buffer
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
209 " composing characters can use many bytes, check for overflow |
9126e872893d
patch 9.0.0527: long sign text may overflow buffer
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
210 sign define manyBytes text=▶᷄᷅᷆◀᷄᷅᷆᷇ |
9126e872893d
patch 9.0.0527: long sign text may overflow buffer
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
211 sign place 17 line=1 name=manyBytes |
9126e872893d
patch 9.0.0527: long sign text may overflow buffer
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
212 redraw |
9126e872893d
patch 9.0.0527: long sign text may overflow buffer
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
213 |
9126e872893d
patch 9.0.0527: long sign text may overflow buffer
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
214 bwipe! |
9126e872893d
patch 9.0.0527: long sign text may overflow buffer
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
215 sign undefine manyBytes |
9126e872893d
patch 9.0.0527: long sign text may overflow buffer
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
216 endfunc |
9126e872893d
patch 9.0.0527: long sign text may overflow buffer
Bram Moolenaar <Bram@vim.org>
parents:
30043
diff
changeset
|
217 |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
218 " Undefining placed sign is not recommended. |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
219 " Quoting :help sign |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
220 " |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
221 " :sign undefine {name} |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
222 " 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
|
223 " 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
|
224 func Test_sign_undefine_still_placed() |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
225 new foobar |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
226 sign define Sign text=x |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
227 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
|
228 sign undefine Sign |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
229 |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
230 " 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
|
231 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
|
232 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
|
233 \ " 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
|
234 |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
235 sign unplace 41 |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
236 let a=execute('sign place') |
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
237 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
|
238 endfunc |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
239 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
240 func Test_sign_completion() |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
241 sign define Sign1 text=x |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
242 sign define Sign2 text=y |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
243 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
244 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
|
245 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
|
246 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
247 call feedkeys(":sign define Sign \<C-A>\<C-B>\"\<CR>", 'tx') |
26690
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
248 call assert_equal('"sign define Sign culhl= icon= linehl= numhl= text= texthl=', @:) |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
249 |
26690
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
250 for hl in ['culhl', 'linehl', 'numhl', 'texthl'] |
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
251 call feedkeys(":sign define Sign "..hl.."=Spell\<C-A>\<C-B>\"\<CR>", 'tx') |
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
252 call assert_equal('"sign define Sign '..hl..'=SpellBad SpellCap ' . |
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
253 \ 'SpellLocal SpellRare', @:) |
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
254 endfor |
15864
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
255 |
30769
ae10b91ac6b3
patch 9.0.0719: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
256 call writefile(repeat(["Sun is shining"], 30), "XsignOne", 'D') |
ae10b91ac6b3
patch 9.0.0719: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
257 call writefile(repeat(["Sky is blue"], 30), "XsignTwo", 'D') |
10044
46e630ac4380
commit https://github.com/vim/vim/commit/64cefedfc834aa4dac54ae5f91ccbc04e2d56bc5
Christian Brabandt <cb@256bit.org>
parents:
9902
diff
changeset
|
258 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
|
259 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
|
260 |
15864
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
261 " 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
|
262 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
|
263 call assert_equal('"sign undefine Sign1 Sign2', @:) |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
264 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
265 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
|
266 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
|
267 \ @:) |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
268 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
269 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
|
270 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
|
271 |
15864
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
272 edit XsignOne |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
273 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
|
274 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
|
275 edit XsignTwo |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
276 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
|
277 |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
278 " 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
|
279 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
|
280 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
|
281 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
|
282 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
|
283 |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
284 " 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
|
285 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
|
286 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
|
287 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
|
288 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
|
289 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
|
290 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
|
291 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
|
292 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
|
293 |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
294 " 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
|
295 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
|
296 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
|
297 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
|
298 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
|
299 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
|
300 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
|
301 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
|
302 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
|
303 |
15864
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
304 " 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
|
305 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
|
306 call assert_equal('"sign list Sign1 Sign2', @:) |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
307 |
15864
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
308 " 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
|
309 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
|
310 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
|
311 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
|
312 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
|
313 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
|
314 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
|
315 |
15864
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
316 " Error cases |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
317 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
|
318 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
|
319 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
|
320 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
|
321 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
|
322 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
|
323 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
|
324 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
|
325 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
|
326 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
|
327 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
|
328 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
|
329 |
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
330 sign unplace * group=* |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
331 sign undefine Sign1 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
332 sign undefine Sign2 |
15864
9e0154efac3a
patch 8.1.0939: no completion for sign group names
Bram Moolenaar <Bram@vim.org>
parents:
15519
diff
changeset
|
333 enew |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
334 endfunc |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
335 |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
336 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
|
337 sign define Sign1 text=x |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
338 |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
339 call assert_fails('sign', 'E471:') |
9838
66f1cf5dd385
commit https://github.com/vim/vim/commit/446a973ce3ce4988607292c0e6345db788f12c7b
Christian Brabandt <cb@256bit.org>
parents:
9816
diff
changeset
|
340 call assert_fails('sign jump', 'E471:') |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
341 call assert_fails('sign xxx', 'E160:') |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
342 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
|
343 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
|
344 call assert_fails('sign undefine', 'E156:') |
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
345 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
|
346 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
|
347 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
|
348 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
|
349 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
|
350 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
|
351 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
|
352 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
|
353 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
|
354 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
|
355 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
|
356 " 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
|
357 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
|
358 \ 'E474:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
359 " 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
|
360 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
|
361 \ 'E474:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
362 " 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
|
363 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
|
364 \ 'E474:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
365 " 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
|
366 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
|
367 \ 'E474:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
368 " 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
|
369 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
|
370 " 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
|
371 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
|
372 \ bufnr('%') . 'xxx', 'E488:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
373 " 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
|
374 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
|
375 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
|
376 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
|
377 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
|
378 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
|
379 " 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
|
380 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
|
381 " 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
|
382 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
|
383 " 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
|
384 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
|
385 " 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
|
386 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
|
387 " 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
|
388 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
|
389 " 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
|
390 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
|
391 " 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
|
392 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
|
393 " 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
|
394 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
|
395 " 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
|
396 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
|
397 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
|
398 " 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
|
399 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
|
400 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
401 sign undefine Sign1 |
9816
74990ddf0813
commit https://github.com/vim/vim/commit/09de17536dd84e43aed7a575183e320e8d980b68
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
402 endfunc |
9902
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
403 |
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
404 func Test_sign_delete_buffer() |
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
405 new |
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
406 sign define Sign text=x |
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
407 let bufnr = bufnr('%') |
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
408 new |
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
409 exe 'bd ' . bufnr |
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
410 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
|
411 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
|
412 sign unplace 61 |
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
413 sign undefine Sign |
5a667a3a3743
commit https://github.com/vim/vim/commit/bfd096d02087a10e8e2f4bdfb74e0435506fa8bb
Christian Brabandt <cb@256bit.org>
parents:
9838
diff
changeset
|
414 endfunc |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
415 |
17807
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
416 " Ignore error: E255: Couldn't read in sign data! |
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
417 " This error can happen when running in the GUI. |
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
418 " Some gui like Motif do not support the png icon format. |
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
419 func Sign_command_ignore_error(cmd) |
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
420 try |
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
421 exe a:cmd |
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
422 catch /E255:/ |
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
423 endtry |
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
424 endfunc |
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
425 |
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
426 " ignore error: E255: Couldn't read in sign data! |
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
427 " This error can happen when running in gui. |
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
428 func Sign_define_ignore_error(name, attr) |
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
429 try |
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
430 call sign_define(a:name, a:attr) |
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
431 catch /E255:/ |
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
432 endtry |
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
433 endfunc |
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
434 |
15271
a6319aca721b
patch 8.1.0644: finding next sign ID is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15247
diff
changeset
|
435 " 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
|
436 func Test_sign_funcs() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
437 " Remove all the signs |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
438 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
439 call sign_undefine() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
440 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
441 " Tests for sign_define() |
26266
365e7f083f02
patch 8.2.3664: cannot adjust sign highlighting for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25690
diff
changeset
|
442 let attr = {'text' : '=>', 'linehl' : 'Search', 'texthl' : 'Error', |
26690
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
443 \ 'culhl': 'Visual', 'numhl': 'Number'} |
17998
ea916dbbb9b9
patch 8.1.1995: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17807
diff
changeset
|
444 call assert_equal(0, "sign1"->sign_define(attr)) |
26690
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
445 call assert_equal([{'name' : 'sign1', 'texthl' : 'Error', 'linehl' : 'Search', |
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
446 \ 'culhl' : 'Visual', 'numhl': 'Number', 'text' : '=>'}], |
26266
365e7f083f02
patch 8.2.3664: cannot adjust sign highlighting for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25690
diff
changeset
|
447 \ sign_getdefined()) |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
448 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
449 " 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
|
450 call sign_define("sign2") |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
451 let attr = {'text' : '!!', 'linehl' : 'DiffAdd', 'texthl' : 'DiffChange', |
26690
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
452 \ 'culhl': 'DiffDelete', 'numhl': 'Number', 'icon' : 'sign2.ico'} |
17807
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
453 call Sign_define_ignore_error("sign2", attr) |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
454 call assert_equal([{'name' : 'sign2', 'texthl' : 'DiffChange', |
26266
365e7f083f02
patch 8.2.3664: cannot adjust sign highlighting for 'cursorline'
Bram Moolenaar <Bram@vim.org>
parents:
25690
diff
changeset
|
455 \ 'linehl' : 'DiffAdd', 'culhl' : 'DiffDelete', 'text' : '!!', |
26690
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
456 \ 'numhl': 'Number', 'icon' : 'sign2.ico'}], |
84d60deb8f82
patch 8.2.3874: cannot highlight the number column for a sign
Bram Moolenaar <Bram@vim.org>
parents:
26434
diff
changeset
|
457 \ "sign2"->sign_getdefined()) |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
458 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
459 " 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
|
460 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
|
461 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
|
462 \ sign_getdefined(0002)) |
17998
ea916dbbb9b9
patch 8.1.1995: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17807
diff
changeset
|
463 eval 0002->sign_undefine() |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
464 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
465 " 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
|
466 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
|
467 call assert_fails('call sign_define("sign5", {"text" : ""})', 'E239:') |
17366
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
468 call assert_fails('call sign_define({})', 'E731:') |
29994
86eb4aba16c3
patch 9.0.0335: checks for Dictionary argument often give a vague error
Bram Moolenaar <Bram@vim.org>
parents:
26690
diff
changeset
|
469 call assert_fails('call sign_define("sign6", [])', 'E1206:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
470 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
471 " Tests for sign_getdefined() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
472 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
|
473 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
|
474 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
475 " Tests for sign_place() |
30769
ae10b91ac6b3
patch 9.0.0719: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
476 call writefile(repeat(["Sun is shining"], 30), "Xsign", 'D') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
477 edit Xsign |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
478 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
479 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
|
480 \ {'lnum' : 20})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
481 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
|
482 \ [{'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
|
483 \ 'priority' : 10}]}], sign_getplaced('Xsign')) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
484 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
|
485 \ [{'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
|
486 \ 'priority' : 10}]}], |
17998
ea916dbbb9b9
patch 8.1.1995: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17807
diff
changeset
|
487 \ '%'->sign_getplaced({'lnum' : 20})) |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
488 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
|
489 \ [{'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
|
490 \ '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
|
491 \ sign_getplaced('', {'id' : 10})) |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
492 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
493 " 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
|
494 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
|
495 call assert_fails('call sign_place(5, "", "mySign", -1)', 'E158:') |
29994
86eb4aba16c3
patch 9.0.0335: checks for Dictionary argument often give a vague error
Bram Moolenaar <Bram@vim.org>
parents:
26690
diff
changeset
|
496 call assert_fails('call sign_place(-1, "", "sign1", "Xsign", [])', 'E1206:') |
15209
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_place(-1, "", "sign1", "Xsign", |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
498 \ {"lnum" : 30})', 'E474:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
499 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
|
500 \ {"lnum" : 30})', 'E155:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
501 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
|
502 \ {"lnum" : 30})', 'E155:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
503 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
|
504 \ {"lnum" : 30})', 'E730:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
505 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
|
506 \ {"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
|
507 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
|
508 \ 'E158:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
509 call assert_fails('call sign_place(5, "", "sign1", [], {"lnum" : 10})', |
21265
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
20625
diff
changeset
|
510 \ 'E730:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
511 call assert_fails('call sign_place(21, "", "sign1", "Xsign", |
17805
313f498c646e
patch 8.1.1899: sign_place() does not work as documented
Bram Moolenaar <Bram@vim.org>
parents:
17427
diff
changeset
|
512 \ {"lnum" : -1})', 'E474:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
513 call assert_fails('call sign_place(22, "", "sign1", "Xsign", |
17805
313f498c646e
patch 8.1.1899: sign_place() does not work as documented
Bram Moolenaar <Bram@vim.org>
parents:
17427
diff
changeset
|
514 \ {"lnum" : 0})', 'E474:') |
15304
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
515 call assert_fails('call sign_place(22, "", "sign1", "Xsign", |
21265
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
20625
diff
changeset
|
516 \ {"lnum" : []})', 'E745:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
517 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
|
518 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
519 " Tests for sign_getplaced() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
520 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
|
521 \ [{'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
|
522 \ 'priority' : 10}]}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
523 \ sign_getplaced(bufnr('Xsign'))) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
524 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
|
525 \ [{'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
|
526 \ 'priority' : 10}]}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
527 \ sign_getplaced()) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
528 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
|
529 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
|
530 call assert_fails('call sign_getplaced(-1)', 'E158:') |
29994
86eb4aba16c3
patch 9.0.0335: checks for Dictionary argument often give a vague error
Bram Moolenaar <Bram@vim.org>
parents:
26690
diff
changeset
|
531 call assert_fails('call sign_getplaced("Xsign", [])', 'E1206:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
532 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
|
533 \ sign_getplaced('Xsign', {'lnum' : 1000000})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
534 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
|
535 \ 'E745:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
536 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
|
537 \ sign_getplaced('Xsign', {'id' : 44})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
538 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
|
539 \ 'E745:') |
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 " Tests for sign_unplace() |
17998
ea916dbbb9b9
patch 8.1.1995: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17807
diff
changeset
|
542 eval 20->sign_place('', 'sign2', 'Xsign', {"lnum" : 30}) |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
543 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
|
544 \ {'id' : 20, 'buffer' : 'Xsign'})) |
17998
ea916dbbb9b9
patch 8.1.1995: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17807
diff
changeset
|
545 call assert_equal(-1, ''->sign_unplace( |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
546 \ {'id' : 30, 'buffer' : 'Xsign'})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
547 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
|
548 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
|
549 \ {'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
|
550 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
|
551 \ {'id' : 20, 'buffer' : '&'})", 'E158:') |
15304
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
552 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
|
553 \ {'id' : 20, 'buffer' : 200})", 'E158:') |
29994
86eb4aba16c3
patch 9.0.0335: checks for Dictionary argument often give a vague error
Bram Moolenaar <Bram@vim.org>
parents:
26690
diff
changeset
|
554 call assert_fails("call sign_unplace('g1', 'mySign')", 'E1206:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
555 |
17366
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
556 call sign_unplace('*') |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
557 |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
558 " Test for modifying a placed sign |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
559 call assert_equal(15, sign_place(15, '', 'sign1', 'Xsign', {'lnum' : 20})) |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
560 call assert_equal(15, sign_place(15, '', 'sign2', 'Xsign')) |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
561 call assert_equal([{'bufnr' : bufnr(''), 'signs' : |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
562 \ [{'id' : 15, 'group' : '', 'lnum' : 20, 'name' : 'sign2', |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
563 \ 'priority' : 10}]}], |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
564 \ sign_getplaced()) |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
565 |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
566 " Tests for sign_undefine() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
567 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
|
568 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
|
569 call assert_fails('call sign_undefine("none")', 'E155:') |
17366
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
570 call assert_fails('call sign_undefine({})', 'E731:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
571 |
17805
313f498c646e
patch 8.1.1899: sign_place() does not work as documented
Bram Moolenaar <Bram@vim.org>
parents:
17427
diff
changeset
|
572 " Test for using '.' as the line number for sign_place() |
17807
b38fa4d37b7c
patch 8.1.1900: sign test fails in the GUI
Bram Moolenaar <Bram@vim.org>
parents:
17805
diff
changeset
|
573 call Sign_define_ignore_error("sign1", attr) |
17805
313f498c646e
patch 8.1.1899: sign_place() does not work as documented
Bram Moolenaar <Bram@vim.org>
parents:
17427
diff
changeset
|
574 call cursor(22, 1) |
313f498c646e
patch 8.1.1899: sign_place() does not work as documented
Bram Moolenaar <Bram@vim.org>
parents:
17427
diff
changeset
|
575 call assert_equal(15, sign_place(15, '', 'sign1', 'Xsign', |
313f498c646e
patch 8.1.1899: sign_place() does not work as documented
Bram Moolenaar <Bram@vim.org>
parents:
17427
diff
changeset
|
576 \ {'lnum' : '.'})) |
313f498c646e
patch 8.1.1899: sign_place() does not work as documented
Bram Moolenaar <Bram@vim.org>
parents:
17427
diff
changeset
|
577 call assert_equal([{'bufnr' : bufnr(''), 'signs' : |
313f498c646e
patch 8.1.1899: sign_place() does not work as documented
Bram Moolenaar <Bram@vim.org>
parents:
17427
diff
changeset
|
578 \ [{'id' : 15, 'group' : '', 'lnum' : 22, 'name' : 'sign1', |
313f498c646e
patch 8.1.1899: sign_place() does not work as documented
Bram Moolenaar <Bram@vim.org>
parents:
17427
diff
changeset
|
579 \ 'priority' : 10}]}], |
313f498c646e
patch 8.1.1899: sign_place() does not work as documented
Bram Moolenaar <Bram@vim.org>
parents:
17427
diff
changeset
|
580 \ sign_getplaced('%', {'lnum' : 22})) |
313f498c646e
patch 8.1.1899: sign_place() does not work as documented
Bram Moolenaar <Bram@vim.org>
parents:
17427
diff
changeset
|
581 |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
582 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
583 call sign_undefine() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
584 enew | only |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
585 endfunc |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
586 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
587 " Tests for sign groups |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
588 func Test_sign_group() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
589 enew | only |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
590 " Remove all the signs |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
591 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
592 call sign_undefine() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
593 |
30769
ae10b91ac6b3
patch 9.0.0719: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
594 call writefile(repeat(["Sun is shining"], 30), "Xsign", 'D') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
595 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
596 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
|
597 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
|
598 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
599 edit Xsign |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
600 let bnum = bufnr('%') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
601 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
602 " Error case |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
603 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
|
604 \ {'lnum' : 30})", 'E730:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
605 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
606 " 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
|
607 " others in the named groups |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
608 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
|
609 \ {'lnum' : 10})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
610 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
|
611 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
|
612 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
613 " 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
|
614 let s = sign_getplaced('Xsign') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
615 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
|
616 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
|
617 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
|
618 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
|
619 \ '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
|
620 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
|
621 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
|
622 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
|
623 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
|
624 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
|
625 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
|
626 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
|
627 \ 'priority' : 10}, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
628 \ {'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
|
629 \ 'priority' : 10}, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
630 \ {'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
|
631 \ 'priority' : 10}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
632 \ s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
633 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
634 " 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
|
635 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
|
636 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
|
637 \ 'priority' : 10}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
638 \ s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
639 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
|
640 call assert_equal( |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
641 \ [{'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
|
642 \ 'priority' : 10}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
643 \ s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
644 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
|
645 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
|
646 \ 'priority' : 10}, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
647 \ {'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
|
648 \ 'priority' : 10}, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
649 \ {'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
|
650 \ 'priority' : 10}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
651 \ 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, {'id' : 5, 'group' : 'g3'}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
653 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
|
654 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
655 " 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
|
656 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
|
657 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
|
658 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
|
659 call assert_equal( |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
660 \ [{'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
|
661 \ 'priority' : 10}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
662 \ s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
663 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
|
664 call assert_equal( |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
665 \ [{'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
|
666 \ 'priority' : 10}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
667 \ s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
668 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
|
669 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
|
670 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
671 " Error case |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
672 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
|
673 \ 'E730:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
674 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
675 " 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
|
676 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
|
677 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
|
678 call assert_equal([ |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
679 \ {'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
|
680 \ 'priority' : 10}, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
681 \ {'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
|
682 \ 'priority' : 10}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
683 \ s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
684 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
685 " 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
|
686 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
|
687 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
|
688 call assert_equal([ |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
689 \ {'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
|
690 \ 'priority' : 10}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
691 \ s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
692 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
693 " 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
|
694 call sign_unplace('*', {'buffer' : bnum}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
695 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
|
696 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
697 " 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
|
698 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
|
699 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
|
700 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
|
701 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
|
702 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
|
703 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
704 " Error case |
30043
fd855ad74887
patch 9.0.0359: error message for wrong argument type is not specific
Bram Moolenaar <Bram@vim.org>
parents:
30015
diff
changeset
|
705 call assert_fails("call sign_unplace({})", 'E1174:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
706 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
707 " 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
|
708 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
|
709 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
|
710 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
711 " 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
|
712 " group |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
713 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
|
714 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
|
715 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
|
716 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
|
717 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
|
718 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
|
719 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
|
720 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
|
721 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
|
722 let s = sign_getplaced(bnum) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
723 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
|
724 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
|
725 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
|
726 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
|
727 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
|
728 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
|
729 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
|
730 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
|
731 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
732 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
733 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
734 " 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
|
735 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
|
736 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
|
737 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
|
738 |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
739 " 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
|
740 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
741 " :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
|
742 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
|
743 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
|
744 \ " 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
|
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 " :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
|
747 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
|
748 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
|
749 \ " 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
|
750 |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
751 " :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
|
752 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
|
753 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
|
754 \ " 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
|
755 \ " 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
|
756 \ " 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
|
757 |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
758 " 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
|
759 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
|
760 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
|
761 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
762 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
763 let bnum = bufnr('Xsign') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
764 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
|
765 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
|
766 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
|
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 " :sign place buffer={fname} |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
769 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
|
770 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
|
771 \ " 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
|
772 |
15300
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 group={group} buffer={fname} |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
774 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
|
775 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
|
776 \ " 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
|
777 |
15300
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 group=* buffer={fname} |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
779 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
|
780 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
|
781 \ " 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
|
782 \ " 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
|
783 \ " 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
|
784 |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
785 " 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
|
786 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
|
787 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
|
788 |
15300
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 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
790 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
|
791 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
|
792 \ " 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
|
793 |
15388
7444fffa482d
patch 8.1.0702: ":sign place" only uses the current buffer
Bram Moolenaar <Bram@vim.org>
parents:
15386
diff
changeset
|
794 " 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
|
795 split foo |
7444fffa482d
patch 8.1.0702: ":sign place" only uses the current buffer
Bram Moolenaar <Bram@vim.org>
parents:
15386
diff
changeset
|
796 set buftype=nofile |
7444fffa482d
patch 8.1.0702: ":sign place" only uses the current buffer
Bram Moolenaar <Bram@vim.org>
parents:
15386
diff
changeset
|
797 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
|
798 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
|
799 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
|
800 \ " 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
|
801 \ "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
|
802 \ " 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
|
803 close |
7444fffa482d
patch 8.1.0702: ":sign place" only uses the current buffer
Bram Moolenaar <Bram@vim.org>
parents:
15386
diff
changeset
|
804 bwipe foo |
7444fffa482d
patch 8.1.0702: ":sign place" only uses the current buffer
Bram Moolenaar <Bram@vim.org>
parents:
15386
diff
changeset
|
805 |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
806 " :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
|
807 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
|
808 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
|
809 \ " 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
|
810 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
811 " :sign place group=* |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
812 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
|
813 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
|
814 \ " 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
|
815 \ " 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
|
816 \ " 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
|
817 |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
818 " 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
|
819 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
|
820 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
|
821 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
|
822 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
|
823 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
|
824 |
15378
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
825 " 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
|
826 sign jump 5 |
0d76dd701e49
patch 8.1.0697: ":sign place" requires the buffer argument
Bram Moolenaar <Bram@vim.org>
parents:
15343
diff
changeset
|
827 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
|
828 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
|
829 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
|
830 |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
831 " Error cases |
15247
336728a577f5
patch 8.1.0632: using sign group names is inefficient
Bram Moolenaar <Bram@vim.org>
parents:
15209
diff
changeset
|
832 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
|
833 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
834 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
835 call sign_undefine() |
15304
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
836 enew | only |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
837 endfunc |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
838 |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
839 " 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
|
840 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
|
841 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
|
842 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
843 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
|
844 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
|
845 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
|
846 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
|
847 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
|
848 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
|
849 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
|
850 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
|
851 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
|
852 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
|
853 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
|
854 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
|
855 endfunc |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
856 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
857 " 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
|
858 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
|
859 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
|
860 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
|
861 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
|
862 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
|
863 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
|
864 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
|
865 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
|
866 endfunc |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
867 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
868 " 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
|
869 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
|
870 enew | only |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
871 " 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
|
872 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
|
873 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
|
874 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
875 " Create two files and define signs |
30769
ae10b91ac6b3
patch 9.0.0719: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
876 call writefile(repeat(["Sun is shining"], 30), "Xsign1", 'D') |
ae10b91ac6b3
patch 9.0.0719: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
877 call writefile(repeat(["It is beautiful"], 30), "Xsign2", 'D') |
15300
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
878 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
879 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
|
880 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
|
881 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
882 edit Xsign1 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
883 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
|
884 split Xsign2 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
885 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
|
886 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
887 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
|
888 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
889 \ {'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
|
890 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
891 \ {'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
|
892 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
893 \ {'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
|
894 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
895 \ {'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
|
896 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
897 \ {'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
|
898 \ 'priority' : 10},] |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
899 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
|
900 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
901 \ {'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
|
902 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
903 \ {'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
|
904 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
905 \ {'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
|
906 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
907 \ {'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
|
908 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
909 \ {'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
|
910 \ 'priority' : 10},] |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
911 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
912 " 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
|
913 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
|
914 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
|
915 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
|
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(signs1), |
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 != 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
|
919 \ 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
|
920 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
|
921 \ 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
|
922 \ {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
|
923 \ 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
|
924 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
925 " 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
|
926 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
|
927 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
|
928 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
|
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(signs1), |
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 != 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
|
932 \ 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
|
933 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
|
934 \ 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
|
935 \ {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
|
936 \ 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
|
937 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
938 " 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
|
939 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
|
940 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
|
941 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
|
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(signs1), |
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 != 3}), |
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('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
|
946 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
|
947 \ 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
|
948 \ {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
|
949 \ 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
|
950 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
951 " 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
|
952 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
|
953 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
|
954 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
|
955 \ 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
|
956 \ {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
|
957 \ 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
|
958 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
|
959 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
960 " 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
|
961 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
|
962 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
|
963 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
|
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(signs1), |
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 != 'g1'}), |
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('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
|
968 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
|
969 \ 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
|
970 \ {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
|
971 \ 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
|
972 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
973 " 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
|
974 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
|
975 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
|
976 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
|
977 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
|
978 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
979 " 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
|
980 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
|
981 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
|
982 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
|
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(signs1), |
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 != 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
|
986 \ 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
|
987 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
|
988 \ 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
|
989 \ {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
|
990 \ 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
|
991 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
992 " 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
|
993 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
|
994 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
|
995 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
|
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(signs1), |
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 != 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
|
999 \ 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
|
1000 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
|
1001 \ 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
|
1002 \ {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
|
1003 \ 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
|
1004 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1005 " 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
|
1006 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
|
1007 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
|
1008 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
|
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(signs1), |
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 != 3}), |
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(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
|
1013 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
|
1014 \ 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
|
1015 \ {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
|
1016 \ 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
|
1017 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1018 " 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
|
1019 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
|
1020 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
|
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(signs1), |
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(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
|
1025 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
|
1026 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1027 " 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
|
1028 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
|
1029 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
|
1030 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
|
1031 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
|
1032 \ 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
|
1033 \ {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
|
1034 \ 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
|
1035 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
|
1036 \ 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
|
1037 \ {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
|
1038 \ 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
|
1039 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1040 " 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
|
1041 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
|
1042 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
|
1043 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
|
1044 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
|
1045 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1046 " 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
|
1047 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
|
1048 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
|
1049 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
|
1050 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
|
1051 \ 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
|
1052 \ {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
|
1053 \ 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
|
1054 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
|
1055 \ 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
|
1056 \ {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
|
1057 \ 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
|
1058 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1059 " 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
|
1060 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
|
1061 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
|
1062 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
|
1063 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
|
1064 \ 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
|
1065 \ {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
|
1066 \ 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
|
1067 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
|
1068 \ 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
|
1069 \ {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
|
1070 \ 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
|
1071 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1072 " 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
|
1073 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
|
1074 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
|
1075 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
|
1076 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
|
1077 \ 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
|
1078 \ {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
|
1079 \ 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
|
1080 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
|
1081 \ 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
|
1082 \ {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
|
1083 \ 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
|
1084 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1085 " 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
|
1086 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
|
1087 sign unplace * |
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.group != ''}), |
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 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
|
1093 \ 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
|
1094 \ {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
|
1095 \ 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
|
1096 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1097 " 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
|
1098 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
|
1099 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
|
1100 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
|
1101 \ 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
|
1102 \ {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
|
1103 \ 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
|
1104 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
|
1105 \ 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
|
1106 \ {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
|
1107 \ 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
|
1108 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1109 " 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
|
1110 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
|
1111 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
|
1112 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
|
1113 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
|
1114 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1115 " 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
|
1116 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
|
1117 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
|
1118 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
|
1119 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
|
1120 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
|
1121 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
|
1122 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1123 " 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
|
1124 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1125 " 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
|
1126 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
|
1127 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1128 \ {'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
|
1129 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1130 \ {'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
|
1131 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1132 \ {'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
|
1133 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1134 \ {'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
|
1135 \ 'priority' : 10}, |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1136 \ {'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
|
1137 \ 'priority' : 10},] |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1138 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
|
1139 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
|
1140 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1141 " 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
|
1142 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
|
1143 sign unplace |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1144 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
|
1145 \ 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
|
1146 \ {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
|
1147 \ 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
|
1148 " 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
|
1149 sign unplace |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1150 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
|
1151 \ 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
|
1152 \ {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
|
1153 \ 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
|
1154 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1155 " 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
|
1156 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
|
1157 " 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
|
1158 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
|
1159 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
|
1160 \ 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
|
1161 \ {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
|
1162 \ 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
|
1163 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
|
1164 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
|
1165 \ 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
|
1166 \ {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
|
1167 \ 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
|
1168 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1169 " 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
|
1170 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
|
1171 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
|
1172 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
|
1173 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
|
1174 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
|
1175 \ 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
|
1176 \ {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
|
1177 \ 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
|
1178 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
|
1179 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
|
1180 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
|
1181 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
|
1182 |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1183 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
|
1184 call sign_undefine() |
15304
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
1185 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
|
1186 endfunc |
890203d87ee5
patch 8.1.0658: deleting signs and completion for :sign is insufficient
Bram Moolenaar <Bram@vim.org>
parents:
15271
diff
changeset
|
1187 |
17366
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1188 " Tests for auto-generating the sign identifier. |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1189 func Test_aaa_sign_id_autogen() |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1190 enew | only |
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 call sign_undefine() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1193 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1194 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
|
1195 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
|
1196 |
30769
ae10b91ac6b3
patch 9.0.0719: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1197 call writefile(repeat(["Sun is shining"], 30), "Xsign", 'D') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1198 edit Xsign |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1199 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1200 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
|
1201 \ {'lnum' : 10})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1202 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
|
1203 \ {'lnum' : 12})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1204 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
|
1205 \ {'lnum' : 14})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1206 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
|
1207 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
|
1208 \ {'lnum' : 12})) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1209 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1210 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
|
1211 \ {'lnum' : 11})) |
15304
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
1212 " 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
|
1213 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
|
1214 \ {'lnum' : 12})) |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1215 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
|
1216 call assert_equal(10, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1217 \ 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
|
1218 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1219 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1220 call sign_undefine() |
15304
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
1221 enew | only |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1222 endfunc |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1223 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1224 " Test for sign priority |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1225 func Test_sign_priority() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1226 enew | only |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1227 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1228 call sign_undefine() |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1229 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1230 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
|
1231 call sign_define("sign1", attr) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1232 call sign_define("sign2", attr) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1233 call sign_define("sign3", attr) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1234 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1235 " Place three signs with different priority in the same line |
30769
ae10b91ac6b3
patch 9.0.0719: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1236 call writefile(repeat(["Sun is shining"], 30), "Xsign", 'D') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1237 edit Xsign |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1238 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1239 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
|
1240 \ {'lnum' : 11, 'priority' : 50}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1241 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
|
1242 \ {'lnum' : 11, 'priority' : 100}) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1243 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
|
1244 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
|
1245 call assert_equal([ |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1246 \ {'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
|
1247 \ 'priority' : 100}, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1248 \ {'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
|
1249 \ 'priority' : 50}, |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1250 \ {'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
|
1251 \ 'priority' : 10}], |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1252 \ s[0].signs) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1253 |
16978
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1254 call sign_unplace('*') |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1255 |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1256 " Three signs on different lines with changing priorities |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1257 call sign_place(1, '', 'sign1', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1258 \ {'lnum' : 11, 'priority' : 50}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1259 call sign_place(2, '', 'sign2', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1260 \ {'lnum' : 12, 'priority' : 60}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1261 call sign_place(3, '', 'sign3', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1262 \ {'lnum' : 13, 'priority' : 70}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1263 call sign_place(2, '', 'sign2', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1264 \ {'lnum' : 12, 'priority' : 40}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1265 call sign_place(3, '', 'sign3', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1266 \ {'lnum' : 13, 'priority' : 30}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1267 call sign_place(1, '', 'sign1', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1268 \ {'lnum' : 11, 'priority' : 50}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1269 let s = sign_getplaced('Xsign', {'group' : '*'}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1270 call assert_equal([ |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1271 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 11, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1272 \ 'priority' : 50}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1273 \ {'id' : 2, 'name' : 'sign2', 'lnum' : 12, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1274 \ 'priority' : 40}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1275 \ {'id' : 3, 'name' : 'sign3', 'lnum' : 13, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1276 \ 'priority' : 30}], |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1277 \ s[0].signs) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1278 |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1279 call sign_unplace('*') |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1280 |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1281 " Two signs on the same line with changing priorities |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1282 call sign_place(1, '', 'sign1', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1283 \ {'lnum' : 4, 'priority' : 20}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1284 call sign_place(2, '', 'sign2', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1285 \ {'lnum' : 4, 'priority' : 30}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1286 let s = sign_getplaced('Xsign', {'group' : '*'}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1287 call assert_equal([ |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1288 \ {'id' : 2, 'name' : 'sign2', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1289 \ 'priority' : 30}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1290 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1291 \ 'priority' : 20}], |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1292 \ s[0].signs) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1293 " Change the priority of the last sign to highest |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1294 call sign_place(1, '', 'sign1', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1295 \ {'lnum' : 4, 'priority' : 40}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1296 let s = sign_getplaced('Xsign', {'group' : '*'}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1297 call assert_equal([ |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1298 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1299 \ 'priority' : 40}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1300 \ {'id' : 2, 'name' : 'sign2', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1301 \ 'priority' : 30}], |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1302 \ s[0].signs) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1303 " Change the priority of the first sign to lowest |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1304 call sign_place(1, '', 'sign1', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1305 \ {'lnum' : 4, 'priority' : 25}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1306 let s = sign_getplaced('Xsign', {'group' : '*'}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1307 call assert_equal([ |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1308 \ {'id' : 2, 'name' : 'sign2', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1309 \ 'priority' : 30}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1310 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1311 \ 'priority' : 25}], |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1312 \ s[0].signs) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1313 call sign_place(1, '', 'sign1', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1314 \ {'lnum' : 4, 'priority' : 45}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1315 call sign_place(2, '', 'sign2', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1316 \ {'lnum' : 4, 'priority' : 55}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1317 let s = sign_getplaced('Xsign', {'group' : '*'}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1318 call assert_equal([ |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1319 \ {'id' : 2, 'name' : 'sign2', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1320 \ 'priority' : 55}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1321 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1322 \ 'priority' : 45}], |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1323 \ s[0].signs) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1324 |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1325 call sign_unplace('*') |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1326 |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1327 " Three signs on the same line with changing priorities |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1328 call sign_place(1, '', 'sign1', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1329 \ {'lnum' : 4, 'priority' : 40}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1330 call sign_place(2, '', 'sign2', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1331 \ {'lnum' : 4, 'priority' : 30}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1332 call sign_place(3, '', 'sign3', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1333 \ {'lnum' : 4, 'priority' : 20}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1334 let s = sign_getplaced('Xsign', {'group' : '*'}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1335 call assert_equal([ |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1336 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1337 \ 'priority' : 40}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1338 \ {'id' : 2, 'name' : 'sign2', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1339 \ 'priority' : 30}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1340 \ {'id' : 3, 'name' : 'sign3', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1341 \ 'priority' : 20}], |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1342 \ s[0].signs) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1343 |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1344 " Change the priority of the middle sign to the highest |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1345 call sign_place(2, '', 'sign2', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1346 \ {'lnum' : 4, 'priority' : 50}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1347 let s = sign_getplaced('Xsign', {'group' : '*'}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1348 call assert_equal([ |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1349 \ {'id' : 2, 'name' : 'sign2', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1350 \ 'priority' : 50}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1351 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1352 \ 'priority' : 40}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1353 \ {'id' : 3, 'name' : 'sign3', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1354 \ 'priority' : 20}], |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1355 \ s[0].signs) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1356 |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1357 " Change the priority of the middle sign to the lowest |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1358 call sign_place(1, '', 'sign1', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1359 \ {'lnum' : 4, 'priority' : 15}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1360 let s = sign_getplaced('Xsign', {'group' : '*'}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1361 call assert_equal([ |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1362 \ {'id' : 2, 'name' : 'sign2', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1363 \ 'priority' : 50}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1364 \ {'id' : 3, 'name' : 'sign3', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1365 \ 'priority' : 20}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1366 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1367 \ 'priority' : 15}], |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1368 \ s[0].signs) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1369 |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1370 " Change the priority of the last sign to the highest |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1371 call sign_place(1, '', 'sign1', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1372 \ {'lnum' : 4, 'priority' : 55}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1373 let s = sign_getplaced('Xsign', {'group' : '*'}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1374 call assert_equal([ |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1375 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1376 \ 'priority' : 55}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1377 \ {'id' : 2, 'name' : 'sign2', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1378 \ 'priority' : 50}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1379 \ {'id' : 3, 'name' : 'sign3', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1380 \ 'priority' : 20}], |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1381 \ s[0].signs) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1382 |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1383 " Change the priority of the first sign to the lowest |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1384 call sign_place(1, '', 'sign1', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1385 \ {'lnum' : 4, 'priority' : 15}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1386 let s = sign_getplaced('Xsign', {'group' : '*'}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1387 call assert_equal([ |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1388 \ {'id' : 2, 'name' : 'sign2', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1389 \ 'priority' : 50}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1390 \ {'id' : 3, 'name' : 'sign3', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1391 \ 'priority' : 20}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1392 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1393 \ 'priority' : 15}], |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1394 \ s[0].signs) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1395 |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1396 call sign_unplace('*') |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1397 |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1398 " Three signs on the same line with changing priorities along with other |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1399 " signs |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1400 call sign_place(1, '', 'sign1', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1401 \ {'lnum' : 2, 'priority' : 10}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1402 call sign_place(2, '', 'sign1', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1403 \ {'lnum' : 4, 'priority' : 30}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1404 call sign_place(3, '', 'sign2', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1405 \ {'lnum' : 4, 'priority' : 20}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1406 call sign_place(4, '', 'sign3', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1407 \ {'lnum' : 4, 'priority' : 25}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1408 call sign_place(5, '', 'sign2', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1409 \ {'lnum' : 6, 'priority' : 80}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1410 let s = sign_getplaced('Xsign', {'group' : '*'}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1411 call assert_equal([ |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1412 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 2, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1413 \ 'priority' : 10}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1414 \ {'id' : 2, 'name' : 'sign1', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1415 \ 'priority' : 30}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1416 \ {'id' : 4, 'name' : 'sign3', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1417 \ 'priority' : 25}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1418 \ {'id' : 3, 'name' : 'sign2', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1419 \ 'priority' : 20}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1420 \ {'id' : 5, 'name' : 'sign2', 'lnum' : 6, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1421 \ 'priority' : 80}], |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1422 \ s[0].signs) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1423 |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1424 " Change the priority of the first sign to lowest |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1425 call sign_place(2, '', 'sign1', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1426 \ {'lnum' : 4, 'priority' : 15}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1427 let s = sign_getplaced('Xsign', {'group' : '*'}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1428 call assert_equal([ |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1429 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 2, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1430 \ 'priority' : 10}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1431 \ {'id' : 4, 'name' : 'sign3', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1432 \ 'priority' : 25}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1433 \ {'id' : 3, 'name' : 'sign2', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1434 \ 'priority' : 20}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1435 \ {'id' : 2, 'name' : 'sign1', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1436 \ 'priority' : 15}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1437 \ {'id' : 5, 'name' : 'sign2', 'lnum' : 6, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1438 \ 'priority' : 80}], |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1439 \ s[0].signs) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1440 |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1441 " Change the priority of the last sign to highest |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1442 call sign_place(2, '', 'sign1', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1443 \ {'lnum' : 4, 'priority' : 30}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1444 let s = sign_getplaced('Xsign', {'group' : '*'}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1445 call assert_equal([ |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1446 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 2, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1447 \ 'priority' : 10}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1448 \ {'id' : 2, 'name' : 'sign1', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1449 \ 'priority' : 30}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1450 \ {'id' : 4, 'name' : 'sign3', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1451 \ 'priority' : 25}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1452 \ {'id' : 3, 'name' : 'sign2', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1453 \ 'priority' : 20}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1454 \ {'id' : 5, 'name' : 'sign2', 'lnum' : 6, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1455 \ 'priority' : 80}], |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1456 \ s[0].signs) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1457 |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1458 " Change the priority of the middle sign to lowest |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1459 call sign_place(4, '', 'sign3', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1460 \ {'lnum' : 4, 'priority' : 15}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1461 let s = sign_getplaced('Xsign', {'group' : '*'}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1462 call assert_equal([ |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1463 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 2, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1464 \ 'priority' : 10}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1465 \ {'id' : 2, 'name' : 'sign1', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1466 \ 'priority' : 30}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1467 \ {'id' : 3, 'name' : 'sign2', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1468 \ 'priority' : 20}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1469 \ {'id' : 4, 'name' : 'sign3', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1470 \ 'priority' : 15}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1471 \ {'id' : 5, 'name' : 'sign2', 'lnum' : 6, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1472 \ 'priority' : 80}], |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1473 \ s[0].signs) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1474 |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1475 " Change the priority of the middle sign to highest |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1476 call sign_place(3, '', 'sign2', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1477 \ {'lnum' : 4, 'priority' : 35}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1478 let s = sign_getplaced('Xsign', {'group' : '*'}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1479 call assert_equal([ |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1480 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 2, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1481 \ 'priority' : 10}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1482 \ {'id' : 3, 'name' : 'sign2', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1483 \ 'priority' : 35}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1484 \ {'id' : 2, 'name' : 'sign1', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1485 \ 'priority' : 30}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1486 \ {'id' : 4, 'name' : 'sign3', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1487 \ 'priority' : 15}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1488 \ {'id' : 5, 'name' : 'sign2', 'lnum' : 6, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1489 \ 'priority' : 80}], |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1490 \ s[0].signs) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1491 |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1492 call sign_unplace('*') |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1493 |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1494 " Multiple signs with the same priority on the same line |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1495 call sign_place(1, '', 'sign1', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1496 \ {'lnum' : 4, 'priority' : 20}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1497 call sign_place(2, '', 'sign2', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1498 \ {'lnum' : 4, 'priority' : 20}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1499 call sign_place(3, '', 'sign3', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1500 \ {'lnum' : 4, 'priority' : 20}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1501 let s = sign_getplaced('Xsign', {'group' : '*'}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1502 call assert_equal([ |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1503 \ {'id' : 3, 'name' : 'sign3', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1504 \ 'priority' : 20}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1505 \ {'id' : 2, 'name' : 'sign2', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1506 \ 'priority' : 20}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1507 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1508 \ 'priority' : 20}], |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1509 \ s[0].signs) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1510 " Place the last sign again with the same priority |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1511 call sign_place(1, '', 'sign1', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1512 \ {'lnum' : 4, 'priority' : 20}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1513 let s = sign_getplaced('Xsign', {'group' : '*'}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1514 call assert_equal([ |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1515 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1516 \ 'priority' : 20}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1517 \ {'id' : 3, 'name' : 'sign3', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1518 \ 'priority' : 20}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1519 \ {'id' : 2, 'name' : 'sign2', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1520 \ 'priority' : 20}], |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1521 \ s[0].signs) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1522 " Place the first sign again with the same priority |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1523 call sign_place(1, '', 'sign1', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1524 \ {'lnum' : 4, 'priority' : 20}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1525 let s = sign_getplaced('Xsign', {'group' : '*'}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1526 call assert_equal([ |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1527 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1528 \ 'priority' : 20}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1529 \ {'id' : 3, 'name' : 'sign3', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1530 \ 'priority' : 20}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1531 \ {'id' : 2, 'name' : 'sign2', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1532 \ 'priority' : 20}], |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1533 \ s[0].signs) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1534 " Place the middle sign again with the same priority |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1535 call sign_place(3, '', 'sign3', 'Xsign', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1536 \ {'lnum' : 4, 'priority' : 20}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1537 let s = sign_getplaced('Xsign', {'group' : '*'}) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1538 call assert_equal([ |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1539 \ {'id' : 3, 'name' : 'sign3', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1540 \ 'priority' : 20}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1541 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1542 \ 'priority' : 20}, |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1543 \ {'id' : 2, 'name' : 'sign2', 'lnum' : 4, 'group' : '', |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1544 \ 'priority' : 20}], |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1545 \ s[0].signs) |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1546 |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1547 call sign_unplace('*') |
15bc5a64bd50
patch 8.1.1489: sign order wrong when priority was changed
Bram Moolenaar <Bram@vim.org>
parents:
16930
diff
changeset
|
1548 |
16930
1689b52cf297
patch 8.1.1466: not updating priority on existing sign
Bram Moolenaar <Bram@vim.org>
parents:
15864
diff
changeset
|
1549 " Place multiple signs with same id on a line with different priority |
1689b52cf297
patch 8.1.1466: not updating priority on existing sign
Bram Moolenaar <Bram@vim.org>
parents:
15864
diff
changeset
|
1550 call sign_place(1, '', 'sign1', 'Xsign', |
1689b52cf297
patch 8.1.1466: not updating priority on existing sign
Bram Moolenaar <Bram@vim.org>
parents:
15864
diff
changeset
|
1551 \ {'lnum' : 5, 'priority' : 20}) |
1689b52cf297
patch 8.1.1466: not updating priority on existing sign
Bram Moolenaar <Bram@vim.org>
parents:
15864
diff
changeset
|
1552 call sign_place(1, '', 'sign2', 'Xsign', |
1689b52cf297
patch 8.1.1466: not updating priority on existing sign
Bram Moolenaar <Bram@vim.org>
parents:
15864
diff
changeset
|
1553 \ {'lnum' : 5, 'priority' : 10}) |
1689b52cf297
patch 8.1.1466: not updating priority on existing sign
Bram Moolenaar <Bram@vim.org>
parents:
15864
diff
changeset
|
1554 let s = sign_getplaced('Xsign', {'lnum' : 5}) |
1689b52cf297
patch 8.1.1466: not updating priority on existing sign
Bram Moolenaar <Bram@vim.org>
parents:
15864
diff
changeset
|
1555 call assert_equal([ |
1689b52cf297
patch 8.1.1466: not updating priority on existing sign
Bram Moolenaar <Bram@vim.org>
parents:
15864
diff
changeset
|
1556 \ {'id' : 1, 'name' : 'sign2', 'lnum' : 5, 'group' : '', |
1689b52cf297
patch 8.1.1466: not updating priority on existing sign
Bram Moolenaar <Bram@vim.org>
parents:
15864
diff
changeset
|
1557 \ 'priority' : 10}], |
1689b52cf297
patch 8.1.1466: not updating priority on existing sign
Bram Moolenaar <Bram@vim.org>
parents:
15864
diff
changeset
|
1558 \ s[0].signs) |
1689b52cf297
patch 8.1.1466: not updating priority on existing sign
Bram Moolenaar <Bram@vim.org>
parents:
15864
diff
changeset
|
1559 call sign_place(1, '', 'sign2', 'Xsign', |
1689b52cf297
patch 8.1.1466: not updating priority on existing sign
Bram Moolenaar <Bram@vim.org>
parents:
15864
diff
changeset
|
1560 \ {'lnum' : 5, 'priority' : 5}) |
1689b52cf297
patch 8.1.1466: not updating priority on existing sign
Bram Moolenaar <Bram@vim.org>
parents:
15864
diff
changeset
|
1561 let s = sign_getplaced('Xsign', {'lnum' : 5}) |
1689b52cf297
patch 8.1.1466: not updating priority on existing sign
Bram Moolenaar <Bram@vim.org>
parents:
15864
diff
changeset
|
1562 call assert_equal([ |
1689b52cf297
patch 8.1.1466: not updating priority on existing sign
Bram Moolenaar <Bram@vim.org>
parents:
15864
diff
changeset
|
1563 \ {'id' : 1, 'name' : 'sign2', 'lnum' : 5, 'group' : '', |
1689b52cf297
patch 8.1.1466: not updating priority on existing sign
Bram Moolenaar <Bram@vim.org>
parents:
15864
diff
changeset
|
1564 \ 'priority' : 5}], |
1689b52cf297
patch 8.1.1466: not updating priority on existing sign
Bram Moolenaar <Bram@vim.org>
parents:
15864
diff
changeset
|
1565 \ s[0].signs) |
1689b52cf297
patch 8.1.1466: not updating priority on existing sign
Bram Moolenaar <Bram@vim.org>
parents:
15864
diff
changeset
|
1566 |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1567 " Error case |
29994
86eb4aba16c3
patch 9.0.0335: checks for Dictionary argument often give a vague error
Bram Moolenaar <Bram@vim.org>
parents:
26690
diff
changeset
|
1568 call assert_fails("call sign_place(1, 'g1', 'sign1', 'Xsign', [])", 'E1206:') |
15304
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
1569 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
|
1570 \ {'priority' : []})", 'E745:') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1571 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1572 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1573 " 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
|
1574 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
|
1575 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
|
1576 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
|
1577 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
|
1578 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
|
1579 \ " 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
|
1580 \ " 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
|
1581 \ " 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
|
1582 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1583 " 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
|
1584 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
|
1585 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
|
1586 \ " 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
|
1587 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1588 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1589 call sign_undefine() |
15304
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
1590 enew | only |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1591 endfunc |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1592 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1593 " 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
|
1594 func Test_sign_memfailures() |
30769
ae10b91ac6b3
patch 9.0.0719: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1595 call writefile(repeat(["Sun is shining"], 30), "Xsign", 'D') |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1596 edit Xsign |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1597 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1598 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
|
1599 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
|
1600 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
|
1601 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
|
1602 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
|
1603 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
|
1604 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
|
1605 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1606 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
|
1607 call sign_define("sign1", attr) |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1608 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
|
1609 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
|
1610 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1611 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
|
1612 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
|
1613 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
|
1614 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
|
1615 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
|
1616 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1617 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
|
1618 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
|
1619 \ 'E342:') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1620 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1621 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
|
1622 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
|
1623 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
|
1624 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
|
1625 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
|
1626 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
|
1627 \ '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
|
1628 |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1629 call sign_unplace('*') |
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1630 call sign_undefine() |
15304
5bfdce4de97f
patch 8.1.0660: sign_cleanup() may leak memory
Bram Moolenaar <Bram@vim.org>
parents:
15300
diff
changeset
|
1631 enew | only |
15209
3a99b2e6d136
patch 8.1.0614: placing signs can be complicated
Bram Moolenaar <Bram@vim.org>
parents:
15156
diff
changeset
|
1632 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
|
1633 |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1634 " 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
|
1635 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
|
1636 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
|
1637 |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1638 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
|
1639 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
|
1640 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
|
1641 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
|
1642 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
|
1643 |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1644 " 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
|
1645 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
|
1646 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
|
1647 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
|
1648 |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1649 " 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
|
1650 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
|
1651 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
|
1652 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
|
1653 |
15519
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1654 " 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
|
1655 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
|
1656 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
|
1657 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
|
1658 |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1659 " 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
|
1660 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
|
1661 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
|
1662 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
|
1663 |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1664 " 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
|
1665 " changes made by this function. |
32721 | 1666 let &g:undolevels=&g:undolevels |
15519
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1667 |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1668 " 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
|
1669 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
|
1670 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
|
1671 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
|
1672 |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1673 " 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
|
1674 undo |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1675 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
|
1676 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
|
1677 |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1678 " Break the undo |
32721 | 1679 let &g:undolevels=&g:undolevels |
15519
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1680 |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1681 " 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
|
1682 " 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
|
1683 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
|
1684 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
|
1685 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
|
1686 |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1687 " 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
|
1688 undo |
89e76a598b30
patch 8.1.0767: when deleting lines at the bottom signs are misplaced
Bram Moolenaar <Bram@vim.org>
parents:
15418
diff
changeset
|
1689 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
|
1690 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
|
1691 |
15343
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1692 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
|
1693 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
|
1694 enew! |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1695 endfunc |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1696 |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1697 " 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
|
1698 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
|
1699 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
|
1700 |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1701 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
|
1702 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
|
1703 |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1704 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
|
1705 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
|
1706 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
|
1707 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
|
1708 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
|
1709 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
|
1710 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
|
1711 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
|
1712 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
|
1713 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
|
1714 |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1715 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
|
1716 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
|
1717 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
|
1718 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
|
1719 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
|
1720 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
|
1721 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
|
1722 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
|
1723 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
|
1724 |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1725 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
|
1726 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
|
1727 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
|
1728 enew! |
8543eaf63f65
patch 8.1.0679: sign functions do not take buffer argument as documented
Bram Moolenaar <Bram@vim.org>
parents:
15322
diff
changeset
|
1729 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
|
1730 |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1731 " 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
|
1732 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
|
1733 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
|
1734 |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1735 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
|
1736 |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1737 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
|
1738 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
|
1739 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
|
1740 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
|
1741 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
|
1742 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
|
1743 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
|
1744 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
|
1745 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
|
1746 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
|
1747 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
|
1748 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
|
1749 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
|
1750 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
|
1751 |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1752 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
|
1753 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
|
1754 call assert_equal(2, line('.')) |
17998
ea916dbbb9b9
patch 8.1.1995: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17807
diff
changeset
|
1755 let r = 6->sign_jump('g1', 'foo') |
15418
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1756 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
|
1757 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
|
1758 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
|
1759 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
|
1760 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
|
1761 |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1762 " 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
|
1763 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
|
1764 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
|
1765 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
|
1766 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
|
1767 call assert_fails('call sign_jump(2, [], "foo")', 'E730:') |
21265
6a4806e326dd
patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents:
20625
diff
changeset
|
1768 call assert_fails('call sign_jump(2, "", {})', 'E731:') |
15418
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1769 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
|
1770 |
51b3c36b0523
patch 8.1.0717: there is no function for the ":sign jump" command
Bram Moolenaar <Bram@vim.org>
parents:
15388
diff
changeset
|
1771 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
|
1772 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
|
1773 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
|
1774 endfunc |
17105
811c5c2f5236
patch 8.1.1552: cursor position is wrong after sign column changes
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
1775 |
811c5c2f5236
patch 8.1.1552: cursor position is wrong after sign column changes
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
1776 " Test for correct cursor position after the sign column appears or disappears. |
811c5c2f5236
patch 8.1.1552: cursor position is wrong after sign column changes
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
1777 func Test_sign_cursor_position() |
20625
116c7bd5e980
patch 8.2.0866: not enough tests for buffer writing
Bram Moolenaar <Bram@vim.org>
parents:
19447
diff
changeset
|
1778 CheckRunVimInTerminal |
17105
811c5c2f5236
patch 8.1.1552: cursor position is wrong after sign column changes
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
1779 |
811c5c2f5236
patch 8.1.1552: cursor position is wrong after sign column changes
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
1780 let lines =<< trim END |
811c5c2f5236
patch 8.1.1552: cursor position is wrong after sign column changes
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
1781 call setline(1, [repeat('x', 75), 'mmmm', 'yyyy']) |
811c5c2f5236
patch 8.1.1552: cursor position is wrong after sign column changes
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
1782 call cursor(2,1) |
31849
dbec60b8c253
patch 9.0.1257: code style is not check in test scripts
Bram Moolenaar <Bram@vim.org>
parents:
31431
diff
changeset
|
1783 sign define s1 texthl=Search text==> |
dbec60b8c253
patch 9.0.1257: code style is not check in test scripts
Bram Moolenaar <Bram@vim.org>
parents:
31431
diff
changeset
|
1784 sign define s2 linehl=Pmenu |
17105
811c5c2f5236
patch 8.1.1552: cursor position is wrong after sign column changes
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
1785 redraw |
31849
dbec60b8c253
patch 9.0.1257: code style is not check in test scripts
Bram Moolenaar <Bram@vim.org>
parents:
31431
diff
changeset
|
1786 sign place 10 line=2 name=s1 |
17105
811c5c2f5236
patch 8.1.1552: cursor position is wrong after sign column changes
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
1787 END |
30769
ae10b91ac6b3
patch 9.0.0719: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1788 call writefile(lines, 'XtestSigncolumn', 'D') |
17105
811c5c2f5236
patch 8.1.1552: cursor position is wrong after sign column changes
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
1789 let buf = RunVimInTerminal('-S XtestSigncolumn', {'rows': 6}) |
19095
5cd0986ab02e
patch 8.2.0108: when sign text is changed a manual redraw is needed
Bram Moolenaar <Bram@vim.org>
parents:
17998
diff
changeset
|
1790 call VerifyScreenDump(buf, 'Test_sign_cursor_1', {}) |
5cd0986ab02e
patch 8.2.0108: when sign text is changed a manual redraw is needed
Bram Moolenaar <Bram@vim.org>
parents:
17998
diff
changeset
|
1791 |
5cd0986ab02e
patch 8.2.0108: when sign text is changed a manual redraw is needed
Bram Moolenaar <Bram@vim.org>
parents:
17998
diff
changeset
|
1792 " Change the sign text |
5cd0986ab02e
patch 8.2.0108: when sign text is changed a manual redraw is needed
Bram Moolenaar <Bram@vim.org>
parents:
17998
diff
changeset
|
1793 call term_sendkeys(buf, ":sign define s1 text=-)\<CR>") |
5cd0986ab02e
patch 8.2.0108: when sign text is changed a manual redraw is needed
Bram Moolenaar <Bram@vim.org>
parents:
17998
diff
changeset
|
1794 call VerifyScreenDump(buf, 'Test_sign_cursor_2', {}) |
17105
811c5c2f5236
patch 8.1.1552: cursor position is wrong after sign column changes
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
1795 |
19447
5b82f041dbbb
patch 8.2.0281: two placed signs in the same line are not combined
Bram Moolenaar <Bram@vim.org>
parents:
19095
diff
changeset
|
1796 " Also place a line HL sign |
5b82f041dbbb
patch 8.2.0281: two placed signs in the same line are not combined
Bram Moolenaar <Bram@vim.org>
parents:
19095
diff
changeset
|
1797 call term_sendkeys(buf, ":sign place 11 line=2 name=s2\<CR>") |
5b82f041dbbb
patch 8.2.0281: two placed signs in the same line are not combined
Bram Moolenaar <Bram@vim.org>
parents:
19095
diff
changeset
|
1798 call VerifyScreenDump(buf, 'Test_sign_cursor_3', {}) |
5b82f041dbbb
patch 8.2.0281: two placed signs in the same line are not combined
Bram Moolenaar <Bram@vim.org>
parents:
19095
diff
changeset
|
1799 |
17105
811c5c2f5236
patch 8.1.1552: cursor position is wrong after sign column changes
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
1800 " update cursor position calculation |
811c5c2f5236
patch 8.1.1552: cursor position is wrong after sign column changes
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
1801 call term_sendkeys(buf, "lh") |
19447
5b82f041dbbb
patch 8.2.0281: two placed signs in the same line are not combined
Bram Moolenaar <Bram@vim.org>
parents:
19095
diff
changeset
|
1802 call term_sendkeys(buf, ":sign unplace 11\<CR>") |
17105
811c5c2f5236
patch 8.1.1552: cursor position is wrong after sign column changes
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
1803 call term_sendkeys(buf, ":sign unplace 10\<CR>") |
19447
5b82f041dbbb
patch 8.2.0281: two placed signs in the same line are not combined
Bram Moolenaar <Bram@vim.org>
parents:
19095
diff
changeset
|
1804 call VerifyScreenDump(buf, 'Test_sign_cursor_4', {}) |
17105
811c5c2f5236
patch 8.1.1552: cursor position is wrong after sign column changes
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
1805 |
22013
125051dff419
patch 8.2.1556: cursorline highlighting always overrules sign highlighting
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1806 " 'cursorline' highlighting overrules sign |
125051dff419
patch 8.2.1556: cursorline highlighting always overrules sign highlighting
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1807 call term_sendkeys(buf, ":sign place 12 line=2 name=s2\<CR>") |
125051dff419
patch 8.2.1556: cursorline highlighting always overrules sign highlighting
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1808 call term_sendkeys(buf, ":set cursorline\<CR>") |
125051dff419
patch 8.2.1556: cursorline highlighting always overrules sign highlighting
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1809 call term_sendkeys(buf, ":hi CursorLine ctermbg=Green\<CR>") |
125051dff419
patch 8.2.1556: cursorline highlighting always overrules sign highlighting
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1810 call term_sendkeys(buf, "2G") |
125051dff419
patch 8.2.1556: cursorline highlighting always overrules sign highlighting
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1811 call term_sendkeys(buf, ":\<CR>") |
125051dff419
patch 8.2.1556: cursorline highlighting always overrules sign highlighting
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1812 call VerifyScreenDump(buf, 'Test_sign_cursor_5', {}) |
31431
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
1813 call term_sendkeys(buf, ":set cursorlineopt=number,screenline\<CR>") |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
1814 call term_sendkeys(buf, ":\<CR>") |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
1815 call VerifyScreenDump(buf, 'Test_sign_cursor_5', {}) |
22013
125051dff419
patch 8.2.1556: cursorline highlighting always overrules sign highlighting
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1816 |
125051dff419
patch 8.2.1556: cursorline highlighting always overrules sign highlighting
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1817 " sign highlighting overrules 'cursorline' |
125051dff419
patch 8.2.1556: cursorline highlighting always overrules sign highlighting
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1818 call term_sendkeys(buf, ":sign unplace 12\<CR>") |
125051dff419
patch 8.2.1556: cursorline highlighting always overrules sign highlighting
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1819 call term_sendkeys(buf, ":sign place 13 line=2 priority=100 name=s2\<CR>") |
125051dff419
patch 8.2.1556: cursorline highlighting always overrules sign highlighting
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1820 call term_sendkeys(buf, ":\<CR>") |
125051dff419
patch 8.2.1556: cursorline highlighting always overrules sign highlighting
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1821 call VerifyScreenDump(buf, 'Test_sign_cursor_6', {}) |
31431
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
1822 call term_sendkeys(buf, ":set cursorlineopt&\<CR>") |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
1823 call term_sendkeys(buf, ":\<CR>") |
552ca9b4218d
patch 9.0.1048: with "screenline" in 'culopt' cursorline highlight is wrong
Bram Moolenaar <Bram@vim.org>
parents:
30769
diff
changeset
|
1824 call VerifyScreenDump(buf, 'Test_sign_cursor_6', {}) |
22013
125051dff419
patch 8.2.1556: cursorline highlighting always overrules sign highlighting
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1825 |
17105
811c5c2f5236
patch 8.1.1552: cursor position is wrong after sign column changes
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
1826 " clean up |
811c5c2f5236
patch 8.1.1552: cursor position is wrong after sign column changes
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
1827 call StopVimInTerminal(buf) |
811c5c2f5236
patch 8.1.1552: cursor position is wrong after sign column changes
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
1828 endfunc |
17129
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1829 |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1830 " Return the 'len' characters in screen starting from (row,col) |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1831 func s:ScreenLine(row, col, len) |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1832 let s = '' |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1833 for i in range(a:len) |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1834 let s .= nr2char(screenchar(a:row, a:col + i)) |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1835 endfor |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1836 return s |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1837 endfunc |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1838 |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1839 " Test for 'signcolumn' set to 'number'. |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1840 func Test_sign_numcol() |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1841 new |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1842 call append(0, "01234") |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1843 " With 'signcolumn' set to 'number', make sure sign is displayed in the |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1844 " number column and line number is not displayed. |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1845 set numberwidth=2 |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1846 set number |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1847 set signcolumn=number |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1848 sign define sign1 text==> |
17427
45c1dc353321
patch 8.1.1712: signs in number column cause text to be misaligned
Bram Moolenaar <Bram@vim.org>
parents:
17366
diff
changeset
|
1849 sign define sign2 text=V |
17129
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1850 sign place 10 line=1 name=sign1 |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1851 redraw! |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1852 call assert_equal("=> 01234", s:ScreenLine(1, 1, 8)) |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1853 |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1854 " With 'signcolumn' set to 'number', when there is no sign, make sure line |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1855 " number is displayed in the number column |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1856 sign unplace 10 |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1857 redraw! |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1858 call assert_equal("1 01234", s:ScreenLine(1, 1, 7)) |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1859 |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1860 " Disable number column. Check whether sign is displayed in the sign column |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1861 set numberwidth=4 |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1862 set nonumber |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1863 sign place 10 line=1 name=sign1 |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1864 redraw! |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1865 call assert_equal("=>01234", s:ScreenLine(1, 1, 7)) |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1866 |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1867 " Enable number column. Check whether sign is displayed in the number column |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1868 set number |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1869 redraw! |
17141
3c0efdd95f8d
patch 8.1.1570: icon signs not displayed properly in the number column
Bram Moolenaar <Bram@vim.org>
parents:
17129
diff
changeset
|
1870 call assert_equal(" => 01234", s:ScreenLine(1, 1, 9)) |
17129
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1871 |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1872 " Disable sign column. Make sure line number is displayed |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1873 set signcolumn=no |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1874 redraw! |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1875 call assert_equal(" 1 01234", s:ScreenLine(1, 1, 9)) |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1876 |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1877 " Enable auto sign column. Make sure both sign and line number are displayed |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1878 set signcolumn=auto |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1879 redraw! |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1880 call assert_equal("=> 1 01234", s:ScreenLine(1, 1, 11)) |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1881 |
17247
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1882 " Test displaying signs in the number column with width 1 |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1883 call sign_unplace('*') |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1884 call append(1, "abcde") |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1885 call append(2, "01234") |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1886 " Enable number column with width 1 |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1887 set number numberwidth=1 signcolumn=auto |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1888 redraw! |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1889 call assert_equal("3 01234", s:ScreenLine(3, 1, 7)) |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1890 " Place a sign and make sure number column width remains the same |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1891 sign place 20 line=2 name=sign1 |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1892 redraw! |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1893 call assert_equal("=>2 abcde", s:ScreenLine(2, 1, 9)) |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1894 call assert_equal(" 3 01234", s:ScreenLine(3, 1, 9)) |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1895 " Set 'signcolumn' to 'number', make sure the number column width increases |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1896 set signcolumn=number |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1897 redraw! |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1898 call assert_equal("=> abcde", s:ScreenLine(2, 1, 8)) |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1899 call assert_equal(" 3 01234", s:ScreenLine(3, 1, 8)) |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1900 " Set 'signcolumn' to 'auto', make sure the number column width is 1. |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1901 set signcolumn=auto |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1902 redraw! |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1903 call assert_equal("=>2 abcde", s:ScreenLine(2, 1, 9)) |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1904 call assert_equal(" 3 01234", s:ScreenLine(3, 1, 9)) |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1905 " Set 'signcolumn' to 'number', make sure the number column width is 2. |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1906 set signcolumn=number |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1907 redraw! |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1908 call assert_equal("=> abcde", s:ScreenLine(2, 1, 8)) |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1909 call assert_equal(" 3 01234", s:ScreenLine(3, 1, 8)) |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1910 " Disable 'number' column |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1911 set nonumber |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1912 redraw! |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1913 call assert_equal("=>abcde", s:ScreenLine(2, 1, 7)) |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1914 call assert_equal(" 01234", s:ScreenLine(3, 1, 7)) |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1915 " Enable 'number' column |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1916 set number |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1917 redraw! |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1918 call assert_equal("=> abcde", s:ScreenLine(2, 1, 8)) |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1919 call assert_equal(" 3 01234", s:ScreenLine(3, 1, 8)) |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1920 " Remove the sign and make sure the width of the number column is 1. |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1921 call sign_unplace('', {'id' : 20}) |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1922 redraw! |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1923 call assert_equal("3 01234", s:ScreenLine(3, 1, 7)) |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1924 " When the first sign is placed with 'signcolumn' set to number, verify that |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1925 " the number column width increases |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1926 sign place 30 line=1 name=sign1 |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1927 redraw! |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1928 call assert_equal("=> 01234", s:ScreenLine(1, 1, 8)) |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1929 call assert_equal(" 2 abcde", s:ScreenLine(2, 1, 8)) |
17427
45c1dc353321
patch 8.1.1712: signs in number column cause text to be misaligned
Bram Moolenaar <Bram@vim.org>
parents:
17366
diff
changeset
|
1930 " Add sign with multi-byte text |
45c1dc353321
patch 8.1.1712: signs in number column cause text to be misaligned
Bram Moolenaar <Bram@vim.org>
parents:
17366
diff
changeset
|
1931 set numberwidth=4 |
45c1dc353321
patch 8.1.1712: signs in number column cause text to be misaligned
Bram Moolenaar <Bram@vim.org>
parents:
17366
diff
changeset
|
1932 sign place 40 line=2 name=sign2 |
45c1dc353321
patch 8.1.1712: signs in number column cause text to be misaligned
Bram Moolenaar <Bram@vim.org>
parents:
17366
diff
changeset
|
1933 redraw! |
45c1dc353321
patch 8.1.1712: signs in number column cause text to be misaligned
Bram Moolenaar <Bram@vim.org>
parents:
17366
diff
changeset
|
1934 call assert_equal(" => 01234", s:ScreenLine(1, 1, 9)) |
45c1dc353321
patch 8.1.1712: signs in number column cause text to be misaligned
Bram Moolenaar <Bram@vim.org>
parents:
17366
diff
changeset
|
1935 call assert_equal(" V abcde", s:ScreenLine(2, 1, 9)) |
17247
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1936 |
cbd0432cf8ff
patch 8.1.1623: display wrong with signs in narrow number column
Bram Moolenaar <Bram@vim.org>
parents:
17141
diff
changeset
|
1937 sign unplace * group=* |
17129
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1938 sign undefine sign1 |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1939 set signcolumn& |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1940 set number& |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1941 enew! | close |
4fb68abc770f
patch 8.1.1564: sign column takes up space
Bram Moolenaar <Bram@vim.org>
parents:
17105
diff
changeset
|
1942 endfunc |
17366
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1943 |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1944 " Test for managing multiple signs using the sign functions |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1945 func Test_sign_funcs_multi() |
30769
ae10b91ac6b3
patch 9.0.0719: too many delete() calls in tests
Bram Moolenaar <Bram@vim.org>
parents:
30383
diff
changeset
|
1946 call writefile(repeat(["Sun is shining"], 30), "Xsign", 'D') |
17366
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1947 edit Xsign |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1948 let bnum = bufnr('') |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1949 |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1950 " Define multiple signs at once |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1951 call assert_equal([0, 0, 0, 0], sign_define([ |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1952 \ {'name' : 'sign1', 'text' : '=>', 'linehl' : 'Search', |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1953 \ 'texthl' : 'Search'}, |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1954 \ {'name' : 'sign2', 'text' : '=>', 'linehl' : 'Search', |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1955 \ 'texthl' : 'Search'}, |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1956 \ {'name' : 'sign3', 'text' : '=>', 'linehl' : 'Search', |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1957 \ 'texthl' : 'Search'}, |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1958 \ {'name' : 'sign4', 'text' : '=>', 'linehl' : 'Search', |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1959 \ 'texthl' : 'Search'}])) |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1960 |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1961 " Negative cases for sign_define() |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1962 call assert_equal([], sign_define([])) |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1963 call assert_equal([-1], sign_define([{}])) |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1964 call assert_fails('call sign_define([6])', 'E715:') |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1965 call assert_fails('call sign_define(["abc"])', 'E715:') |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1966 call assert_fails('call sign_define([[]])', 'E715:') |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1967 |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1968 " Place multiple signs at once with specific sign identifier |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1969 let l = sign_placelist([{'id' : 1, 'group' : 'g1', 'name' : 'sign1', |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1970 \ 'buffer' : 'Xsign', 'lnum' : 11, 'priority' : 50}, |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1971 \ {'id' : 2, 'group' : 'g2', 'name' : 'sign2', |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1972 \ 'buffer' : 'Xsign', 'lnum' : 11, 'priority' : 100}, |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1973 \ {'id' : 3, 'group' : '', 'name' : 'sign3', |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1974 \ 'buffer' : 'Xsign', 'lnum' : 11}]) |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1975 call assert_equal([1, 2, 3], l) |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1976 let s = sign_getplaced('Xsign', {'group' : '*'}) |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1977 call assert_equal([ |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1978 \ {'id' : 2, 'name' : 'sign2', 'lnum' : 11, |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1979 \ 'group' : 'g2', 'priority' : 100}, |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1980 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 11, |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1981 \ 'group' : 'g1', 'priority' : 50}, |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1982 \ {'id' : 3, 'name' : 'sign3', 'lnum' : 11, |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1983 \ 'group' : '', 'priority' : 10}], s[0].signs) |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1984 |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1985 call sign_unplace('*') |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1986 |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1987 " Place multiple signs at once with auto-generated sign identifier |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1988 call assert_equal([1, 1, 5], sign_placelist([ |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1989 \ {'group' : 'g1', 'name' : 'sign1', |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1990 \ 'buffer' : 'Xsign', 'lnum' : 11}, |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1991 \ {'group' : 'g2', 'name' : 'sign2', |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1992 \ 'buffer' : 'Xsign', 'lnum' : 11}, |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1993 \ {'group' : '', 'name' : 'sign3', |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1994 \ 'buffer' : 'Xsign', 'lnum' : 11}])) |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1995 let s = sign_getplaced('Xsign', {'group' : '*'}) |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1996 call assert_equal([ |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1997 \ {'id' : 5, 'name' : 'sign3', 'lnum' : 11, |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1998 \ 'group' : '', 'priority' : 10}, |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
1999 \ {'id' : 1, 'name' : 'sign2', 'lnum' : 11, |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2000 \ 'group' : 'g2', 'priority' : 10}, |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2001 \ {'id' : 1, 'name' : 'sign1', 'lnum' : 11, |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2002 \ 'group' : 'g1', 'priority' : 10}], s[0].signs) |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2003 |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2004 " Change an existing sign without specifying the group |
17998
ea916dbbb9b9
patch 8.1.1995: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17807
diff
changeset
|
2005 call assert_equal([5], [{'id' : 5, 'name' : 'sign1', 'buffer' : 'Xsign'}]->sign_placelist()) |
17366
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2006 let s = sign_getplaced('Xsign', {'id' : 5, 'group' : ''}) |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2007 call assert_equal([{'id' : 5, 'name' : 'sign1', 'lnum' : 11, |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2008 \ 'group' : '', 'priority' : 10}], s[0].signs) |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2009 |
17805
313f498c646e
patch 8.1.1899: sign_place() does not work as documented
Bram Moolenaar <Bram@vim.org>
parents:
17427
diff
changeset
|
2010 " Place a sign using '.' as the line number |
313f498c646e
patch 8.1.1899: sign_place() does not work as documented
Bram Moolenaar <Bram@vim.org>
parents:
17427
diff
changeset
|
2011 call cursor(23, 1) |
313f498c646e
patch 8.1.1899: sign_place() does not work as documented
Bram Moolenaar <Bram@vim.org>
parents:
17427
diff
changeset
|
2012 call assert_equal([7], sign_placelist([ |
313f498c646e
patch 8.1.1899: sign_place() does not work as documented
Bram Moolenaar <Bram@vim.org>
parents:
17427
diff
changeset
|
2013 \ {'id' : 7, 'name' : 'sign1', 'buffer' : '%', 'lnum' : '.'}])) |
313f498c646e
patch 8.1.1899: sign_place() does not work as documented
Bram Moolenaar <Bram@vim.org>
parents:
17427
diff
changeset
|
2014 let s = sign_getplaced('%', {'lnum' : '.'}) |
313f498c646e
patch 8.1.1899: sign_place() does not work as documented
Bram Moolenaar <Bram@vim.org>
parents:
17427
diff
changeset
|
2015 call assert_equal([{'id' : 7, 'name' : 'sign1', 'lnum' : 23, |
313f498c646e
patch 8.1.1899: sign_place() does not work as documented
Bram Moolenaar <Bram@vim.org>
parents:
17427
diff
changeset
|
2016 \ 'group' : '', 'priority' : 10}], s[0].signs) |
313f498c646e
patch 8.1.1899: sign_place() does not work as documented
Bram Moolenaar <Bram@vim.org>
parents:
17427
diff
changeset
|
2017 |
17366
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2018 " Place sign without a sign name |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2019 call assert_equal([-1], sign_placelist([{'id' : 10, 'buffer' : 'Xsign', |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2020 \ 'lnum' : 12, 'group' : ''}])) |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2021 |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2022 " Place sign without a buffer |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2023 call assert_equal([-1], sign_placelist([{'id' : 10, 'name' : 'sign1', |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2024 \ 'lnum' : 12, 'group' : ''}])) |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2025 |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2026 " Invalid arguments |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2027 call assert_equal([], sign_placelist([])) |
30015
adb0de8be4ce
patch 9.0.0345: error message for list argument could be clearer
Bram Moolenaar <Bram@vim.org>
parents:
29994
diff
changeset
|
2028 call assert_fails('call sign_placelist({})', "E1211:") |
17366
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2029 call assert_fails('call sign_placelist([[]])', "E715:") |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2030 call assert_fails('call sign_placelist(["abc"])', "E715:") |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2031 call assert_fails('call sign_placelist([100])', "E715:") |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2032 |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2033 " Unplace multiple signs |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2034 call assert_equal([0, 0, 0], sign_unplacelist([{'id' : 5}, |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2035 \ {'id' : 1, 'group' : 'g1'}, {'id' : 1, 'group' : 'g2'}])) |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2036 |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2037 " Invalid arguments |
17998
ea916dbbb9b9
patch 8.1.1995: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17807
diff
changeset
|
2038 call assert_equal([], []->sign_unplacelist()) |
30015
adb0de8be4ce
patch 9.0.0345: error message for list argument could be clearer
Bram Moolenaar <Bram@vim.org>
parents:
29994
diff
changeset
|
2039 call assert_fails('call sign_unplacelist({})', "E1211:") |
17366
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2040 call assert_fails('call sign_unplacelist([[]])', "E715:") |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2041 call assert_fails('call sign_unplacelist(["abc"])', "E715:") |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2042 call assert_fails('call sign_unplacelist([100])', "E715:") |
22087
ff21e2962490
patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents:
22013
diff
changeset
|
2043 call assert_fails("call sign_unplacelist([{'id' : -1}])", 'E474:') |
17366
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2044 |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2045 call assert_equal([0, 0, 0, 0], |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2046 \ sign_undefine(['sign1', 'sign2', 'sign3', 'sign4'])) |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2047 call assert_equal([], sign_getdefined()) |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2048 |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2049 " Invalid arguments |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2050 call assert_equal([], sign_undefine([])) |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2051 call assert_fails('call sign_undefine([[]])', 'E730:') |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2052 call assert_fails('call sign_undefine([{}])', 'E731:') |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2053 call assert_fails('call sign_undefine(["1abc2"])', 'E155:') |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2054 |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2055 call sign_unplace('*') |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2056 call sign_undefine() |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2057 enew! |
9843fbfa0ee5
patch 8.1.1682: placing a larger number of signs is slow
Bram Moolenaar <Bram@vim.org>
parents:
17247
diff
changeset
|
2058 endfunc |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
21265
diff
changeset
|
2059 |
25690
cb0868062915
patch 8.2.3381: crash when using NULL list with sign functions
Bram Moolenaar <Bram@vim.org>
parents:
22087
diff
changeset
|
2060 func Test_sign_null_list() |
cb0868062915
patch 8.2.3381: crash when using NULL list with sign functions
Bram Moolenaar <Bram@vim.org>
parents:
22087
diff
changeset
|
2061 eval test_null_list()->sign_define() |
cb0868062915
patch 8.2.3381: crash when using NULL list with sign functions
Bram Moolenaar <Bram@vim.org>
parents:
22087
diff
changeset
|
2062 eval test_null_list()->sign_placelist() |
cb0868062915
patch 8.2.3381: crash when using NULL list with sign functions
Bram Moolenaar <Bram@vim.org>
parents:
22087
diff
changeset
|
2063 eval test_null_list()->sign_undefine() |
cb0868062915
patch 8.2.3381: crash when using NULL list with sign functions
Bram Moolenaar <Bram@vim.org>
parents:
22087
diff
changeset
|
2064 eval test_null_list()->sign_unplacelist() |
cb0868062915
patch 8.2.3381: crash when using NULL list with sign functions
Bram Moolenaar <Bram@vim.org>
parents:
22087
diff
changeset
|
2065 endfunc |
cb0868062915
patch 8.2.3381: crash when using NULL list with sign functions
Bram Moolenaar <Bram@vim.org>
parents:
22087
diff
changeset
|
2066 |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
21265
diff
changeset
|
2067 " vim: shiftwidth=2 sts=2 expandtab |