summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0658
blob: 6048cc5fd00abd3d4b8fd416a0cea1c426f3e212 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0658
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0658
Problem:    Deleting signs and completion for :sign is insufficient.
Solution:   Add deleting signs in a specified or any group from the current
            cursor location.  Add group and priority to sign command
            completion. Add tests for different sign unplace commands. Update
            help text.  Add tests for sign jump with group. Update help for
            sign jump. (Yegappan Lakshmanan, closes #3731)
Files:	    runtime/doc/sign.txt, src/buffer.c, src/evalfunc.c, src/ex_cmds.c,
            src/netbeans.c, src/proto/buffer.pro, src/proto/ex_cmds.pro,
            src/testdir/test_signs.vim


*** ../vim-8.1.0657/runtime/doc/sign.txt	2018-12-21 15:16:57.475579814 +0100
--- runtime/doc/sign.txt	2018-12-29 18:36:00.268781805 +0100
***************
*** 251,263 ****
  		all the files it appears in.
  
  :sign unplace *
! 		Remove all placed signs in the global group.
  
  :sign unplace * group=*
! 		Remove all placed signs in all the groups.
  
  :sign unplace
! 		Remove the placed sign at the cursor position.
  
  
  LISTING PLACED SIGNS					*:sign-place-list*
--- 251,274 ----
  		all the files it appears in.
  
  :sign unplace *
! 		Remove placed signs in the global group from all the files.
! 
! :sign unplace * group={group}
! 		Remove placed signs in group {group} from all the files.
  
  :sign unplace * group=*
! 		Remove placed signs in all the groups from all the files.
  
  :sign unplace
! 		Remove a placed sign at the cursor position. If multiple signs
! 		are placed in the line, then only one is removed.
! 
! :sign unplace group={group}
! 		Remove a placed sign in group {group} at the cursor
! 		position.
! 
! :sign unplace group=*
! 		Remove a placed sign in any group at the cursor position.
  
  
  LISTING PLACED SIGNS					*:sign-place-list*
***************
*** 271,286 ****
  :sign place group={group} file={fname}
  		List signs in group {group} placed in file {fname}.
  
  :sign place buffer={nr}
  		List signs placed in buffer {nr}.
  
  :sign place group={group} buffer={nr}
  		List signs in group {group} placed in buffer {nr}.
  
! :sign place	List placed signs in all files.
  
  :sign place group={group}
! 		List placed signs in all sign groups in all the files.
  
  
  JUMPING TO A SIGN					*:sign-jump* *E157*
--- 282,306 ----
  :sign place group={group} file={fname}
  		List signs in group {group} placed in file {fname}.
  
+ :sign place group=* file={fname}
+ 		List signs in all the groups placed in file {fname}.
+ 
  :sign place buffer={nr}
  		List signs placed in buffer {nr}.
  
  :sign place group={group} buffer={nr}
  		List signs in group {group} placed in buffer {nr}.
  
! :sign place group=* buffer={nr}
! 		List signs in all the groups placed in buffer {nr}.
! 
! :sign place	List placed signs in the global group in all files.
  
  :sign place group={group}
! 		List placed signs with sign group {group} in all files.
! 
! :sign place group=*
! 		List placed signs in all sign groups in all files.
  
  
  JUMPING TO A SIGN					*:sign-jump* *E157*
***************
*** 292,300 ****
--- 312,326 ----
  		If the file isn't displayed in window and the current file can
  		not be |abandon|ed this fails.
  
+ :sign jump {id} group={group} file={fname}
+ 		Same but jump to the sign in group {group}
+ 
  :sign jump {id} buffer={nr}					*E934*
  		Same, but use buffer {nr}.  This fails if buffer {nr} does not
  		have a name.
  
+ :sign jump {id} group={group} buffer={nr}
+ 		Same but jump to the sign in group {group}
+ 
  
   vim:tw=78:ts=8:noet:ft=help:norl:
*** ../vim-8.1.0657/src/buffer.c	2018-12-27 00:28:27.497299324 +0100
--- src/buffer.c	2018-12-29 18:38:43.291325605 +0100
***************
*** 6077,6086 ****
      int
  sign_in_group(signlist_T *sign, char_u *group)
  {
!     return ((group != NULL && STRCMP(group, "*") == 0) ||
! 	    (group == NULL && sign->group == NULL) ||
! 	    (group != NULL && sign->group != NULL &&
! 				STRCMP(group, sign->group->sg_name) == 0));
  }
  
  /*
--- 6077,6086 ----
      int
  sign_in_group(signlist_T *sign, char_u *group)
  {
!     return ((group != NULL && STRCMP(group, "*") == 0)
! 	    || (group == NULL && sign->group == NULL)
! 	    || (group != NULL && sign->group != NULL
! 				 && STRCMP(group, sign->group->sg_name) == 0));
  }
  
  /*
***************
*** 6207,6212 ****
--- 6207,6213 ----
      linenr_T
  buf_delsign(
      buf_T	*buf,		// buffer sign is stored in
+     linenr_T	atlnum,		// sign at this line, 0 - at any line
      int		id,		// sign id
      char_u	*group)		// sign group
  {
***************
*** 6220,6226 ****
      for (sign = buf->b_signlist; sign != NULL; sign = next)
      {
  	next = sign->next;
! 	if ((id == 0 || sign->id == id) && sign_in_group(sign, group))
  
  	{
  	    *lastp = next;
--- 6221,6229 ----
      for (sign = buf->b_signlist; sign != NULL; sign = next)
      {
  	next = sign->next;
! 	if ((id == 0 || sign->id == id) &&
! 		(atlnum == 0 || sign->lnum == atlnum) &&
! 		sign_in_group(sign, group))
  
  	{
  	    *lastp = next;
***************
*** 6230,6237 ****
  	    if (sign->group != NULL)
  		sign_group_unref(sign->group->sg_name);
  	    vim_free(sign);
  	    // Check whether only one sign needs to be deleted
! 	    if (group == NULL || (*group != '*' && id != 0))
  		break;
  	}
  	else
--- 6233,6246 ----
  	    if (sign->group != NULL)
  		sign_group_unref(sign->group->sg_name);
  	    vim_free(sign);
+ 	    update_debug_sign(buf, lnum);
  	    // Check whether only one sign needs to be deleted
! 	    // If deleting a sign with a specific identifer in a particular
! 	    // group or deleting any sign at a particular line number, delete
! 	    // only one sign.
! 	    if (group == NULL
! 		    || (*group != '*' && id != 0)
! 		    || (*group == '*' && atlnum != 0))
  		break;
  	}
  	else
***************
*** 6272,6288 ****
  
  /*
   * Return the sign at line 'lnum' in buffer 'buf'. Returns NULL if a sign is
!  * not found at the line.
   */
      static signlist_T *
  buf_getsign_at_line(
      buf_T	*buf,		// buffer whose sign we are searching for
!     linenr_T	lnum)		// line number of sign
  {
      signlist_T	*sign;		// a sign in the signlist
  
      FOR_ALL_SIGNS_IN_BUF(buf, sign)
! 	if (sign->lnum == lnum)
  	    return sign;
  
      return NULL;
--- 6281,6298 ----
  
  /*
   * Return the sign at line 'lnum' in buffer 'buf'. Returns NULL if a sign is
!  * not found at the line. If 'groupname' is NULL, searches in the global group.
   */
      static signlist_T *
  buf_getsign_at_line(
      buf_T	*buf,		// buffer whose sign we are searching for
!     linenr_T	lnum,		// line number of sign
!     char_u	*groupname)	// sign group name
  {
      signlist_T	*sign;		// a sign in the signlist
  
      FOR_ALL_SIGNS_IN_BUF(buf, sign)
! 	if (sign->lnum == lnum && sign_in_group(sign, groupname))
  	    return sign;
  
      return NULL;
***************
*** 6312,6322 ****
      int
  buf_findsign_id(
      buf_T	*buf,		// buffer whose sign we are searching for
!     linenr_T	lnum)		// line number of sign
  {
      signlist_T	*sign;		// a sign in the signlist
  
!     sign = buf_getsign_at_line(buf, lnum);
      if (sign != NULL)
  	return sign->id;
  
--- 6322,6333 ----
      int
  buf_findsign_id(
      buf_T	*buf,		// buffer whose sign we are searching for
!     linenr_T	lnum,		// line number of sign
!     char_u	*groupname)	// sign group name
  {
      signlist_T	*sign;		// a sign in the signlist
  
!     sign = buf_getsign_at_line(buf, lnum, groupname);
      if (sign != NULL)
  	return sign->id;
  
***************
*** 6401,6416 ****
  }
  
  /*
!  * Delete all signs in all buffers.
   */
      void
! buf_delete_all_signs(void)
  {
      buf_T	*buf;		/* buffer we are checking for signs */
  
      FOR_ALL_BUFFERS(buf)
  	if (buf->b_signlist != NULL)
! 	    buf_delete_signs(buf, (char_u *)"*");
  }
  
  /*
--- 6412,6427 ----
  }
  
  /*
!  * Delete all the signs in the specified group in all the buffers.
   */
      void
! buf_delete_all_signs(char_u *groupname)
  {
      buf_T	*buf;		/* buffer we are checking for signs */
  
      FOR_ALL_BUFFERS(buf)
  	if (buf->b_signlist != NULL)
! 	    buf_delete_signs(buf, groupname);
  }
  
  /*
*** ../vim-8.1.0657/src/evalfunc.c	2018-12-27 23:44:34.797953474 +0100
--- src/evalfunc.c	2018-12-29 18:36:00.272781771 +0100
***************
*** 11600,11611 ****
      {
  	// Delete the sign in all the buffers
  	FOR_ALL_BUFFERS(buf)
! 	    if (sign_unplace(sign_id, group, buf) == OK)
  		rettv->vval.v_number = 0;
      }
      else
      {
! 	if (sign_unplace(sign_id, group, buf) == OK)
  	    rettv->vval.v_number = 0;
      }
      vim_free(group);
--- 11600,11611 ----
      {
  	// Delete the sign in all the buffers
  	FOR_ALL_BUFFERS(buf)
! 	    if (sign_unplace(sign_id, group, buf, 0) == OK)
  		rettv->vval.v_number = 0;
      }
      else
      {
! 	if (sign_unplace(sign_id, group, buf, 0) == OK)
  	    rettv->vval.v_number = 0;
      }
      vim_free(group);
*** ../vim-8.1.0657/src/ex_cmds.c	2018-12-27 00:28:27.497299324 +0100
--- src/ex_cmds.c	2018-12-29 18:36:00.272781771 +0100
***************
*** 7895,7901 ****
   * Unplace the specified sign
   */
      int
! sign_unplace(int sign_id, char_u *sign_group, buf_T *buf)
  {
      if (sign_id == 0)
      {
--- 7895,7901 ----
   * Unplace the specified sign
   */
      int
! sign_unplace(int sign_id, char_u *sign_group, buf_T *buf, linenr_T atlnum)
  {
      if (sign_id == 0)
      {
***************
*** 7908,7923 ****
  	linenr_T	lnum;
  
  	// Delete only the specified signs
! 	lnum = buf_delsign(buf, sign_id, sign_group);
  	if (lnum == 0)
  	    return FAIL;
- 	update_debug_sign(buf, lnum);
      }
  
      return OK;
  }
  
  /*
   * ":sign" command
   */
      void
--- 7908,7937 ----
  	linenr_T	lnum;
  
  	// Delete only the specified signs
! 	lnum = buf_delsign(buf, atlnum, sign_id, sign_group);
  	if (lnum == 0)
  	    return FAIL;
      }
  
      return OK;
  }
  
  /*
+  * Unplace the sign at the current cursor line.
+  */
+     static void
+ sign_unplace_at_cursor(char_u *groupname)
+ {
+     int		id = -1;
+ 
+     id = buf_findsign_id(curwin->w_buffer, curwin->w_cursor.lnum, groupname);
+     if (id > 0)
+ 	sign_unplace(id, groupname, curwin->w_buffer, curwin->w_cursor.lnum);
+     else
+ 	EMSG(_("E159: Missing sign number"));
+ }
+ 
+ /*
   * ":sign" command
   */
      void
***************
*** 8047,8060 ****
  		sign_list_placed(NULL, NULL);
  	    }
  	    else if (idx == SIGNCMD_UNPLACE)
- 	    {
  		/* ":sign unplace": remove placed sign at cursor */
! 		id = buf_findsign_id(curwin->w_buffer, curwin->w_cursor.lnum);
! 		if (id > 0)
! 		    sign_unplace(id, NULL, curwin->w_buffer);
! 		else
! 		    EMSG(_("E159: Missing sign number"));
! 	    }
  	    else
  		EMSG(_(e_argreq));
  	    return;
--- 8061,8068 ----
  		sign_list_placed(NULL, NULL);
  	    }
  	    else if (idx == SIGNCMD_UNPLACE)
  		/* ":sign unplace": remove placed sign at cursor */
! 		sign_unplace_at_cursor(NULL);
  	    else
  		EMSG(_(e_argreq));
  	    return;
***************
*** 8063,8069 ****
  	if (idx == SIGNCMD_UNPLACE && arg[0] == '*' && arg[1] == NUL)
  	{
  	    /* ":sign unplace *": remove all placed signs */
! 	    buf_delete_all_signs();
  	    return;
  	}
  
--- 8071,8077 ----
  	if (idx == SIGNCMD_UNPLACE && arg[0] == '*' && arg[1] == NUL)
  	{
  	    /* ":sign unplace *": remove all placed signs */
! 	    buf_delete_all_signs(NULL);
  	    return;
  	}
  
***************
*** 8084,8090 ****
  		{
  		    /* ":sign unplace {id}": remove placed sign by number */
  		    FOR_ALL_BUFFERS(buf)
! 			sign_unplace(id, NULL, buf);
  		    return;
  		}
  	    }
--- 8092,8098 ----
  		{
  		    /* ":sign unplace {id}": remove placed sign by number */
  		    FOR_ALL_BUFFERS(buf)
! 			sign_unplace(id, NULL, buf, 0);
  		    return;
  		}
  	    }
***************
*** 8183,8189 ****
  	}
  	else if (idx == SIGNCMD_JUMP)
  	{
! 	    /* ":sign jump {id} file={fname}" */
  	    if (lnum >= 0 || sign_name != NULL || buf == NULL)
  		EMSG(_(e_invarg));
  	    else if ((lnum = buf_findsign(buf, id, group)) > 0)
--- 8191,8198 ----
  	}
  	else if (idx == SIGNCMD_JUMP)
  	{
! 	    // ":sign jump {id} file={fname}"
! 	    // ":sign jump {id} group={group} file={fname}"
  	    if (lnum >= 0 || sign_name != NULL || buf == NULL)
  		EMSG(_(e_invarg));
  	    else if ((lnum = buf_findsign(buf, id, group)) > 0)
***************
*** 8225,8231 ****
  	    {
  		if (buf != NULL)
  		    // ":sign unplace * file={fname}"
! 		    sign_unplace(0, group, buf);
  		else
  		    // ":sign unplace * group=*": remove all placed signs
  		    FOR_ALL_BUFFERS(buf)
--- 8234,8240 ----
  	    {
  		if (buf != NULL)
  		    // ":sign unplace * file={fname}"
! 		    sign_unplace(0, group, buf, 0);
  		else
  		    // ":sign unplace * group=*": remove all placed signs
  		    FOR_ALL_BUFFERS(buf)
***************
*** 8238,8251 ****
  		    // ":sign unplace {id} file={fname}"
  		    // ":sign unplace {id} group={group} file={fname}"
  		    // ":sign unplace {id} group=* file={fname}"
! 		    sign_unplace(id, group, buf);
  		else
! 		    // ":sign unplace {id} group={group}":
! 		    // ":sign unplace {id} group=*":
! 		    //     remove all placed signs in this group.
! 		    FOR_ALL_BUFFERS(buf)
! 			if (buf->b_signlist != NULL)
! 			    sign_unplace(id, group, buf);
  	    }
  	}
  	    /* idx == SIGNCMD_PLACE */
--- 8247,8272 ----
  		    // ":sign unplace {id} file={fname}"
  		    // ":sign unplace {id} group={group} file={fname}"
  		    // ":sign unplace {id} group=* file={fname}"
! 		    sign_unplace(id, group, buf, 0);
  		else
! 		{
! 		    if (id == -1)
! 		    {
! 			// ":sign unplace group={group}":
! 			// ":sign unplace group=*":
! 			// remove sign in the current line in specified group
! 			sign_unplace_at_cursor(group);
! 		    }
! 		    else
! 		    {
! 			// ":sign unplace {id} group={group}":
! 			// ":sign unplace {id} group=*":
! 			//     remove all placed signs in this group.
! 			FOR_ALL_BUFFERS(buf)
! 			    if (buf->b_signlist != NULL)
! 				sign_unplace(id, group, buf, 0);
! 		    }
! 		}
  	    }
  	}
  	    /* idx == SIGNCMD_PLACE */
***************
*** 8581,8593 ****
  	{
  	    char *place_arg[] =
  	    {
! 		"line=", "name=", "file=", "buffer=", NULL
  	    };
  	    return (char_u *)place_arg[idx];
  	}
      case EXP_UNPLACE:
  	{
! 	    char *unplace_arg[] = { "file=", "buffer=", NULL };
  	    return (char_u *)unplace_arg[idx];
  	}
      case EXP_SIGN_NAMES:
--- 8602,8615 ----
  	{
  	    char *place_arg[] =
  	    {
! 		"line=", "name=", "group=", "priority=", "file=",
! 		"buffer=", NULL
  	    };
  	    return (char_u *)place_arg[idx];
  	}
      case EXP_UNPLACE:
  	{
! 	    char *unplace_arg[] = { "group=", "file=", "buffer=", NULL };
  	    return (char_u *)unplace_arg[idx];
  	}
      case EXP_SIGN_NAMES:
*** ../vim-8.1.0657/src/netbeans.c	2018-12-21 15:16:57.479579788 +0100
--- src/netbeans.c	2018-12-29 18:36:00.272781771 +0100
***************
*** 1251,1262 ****
  		    /* delete signs from the lines being deleted */
  		    for (i = del_from_lnum; i <= del_to_lnum; i++)
  		    {
! 			int id = buf_findsign_id(buf->bufp, (linenr_T)i);
  			if (id > 0)
  			{
  			    nbdebug(("    Deleting sign %d on line %d\n",
  								      id, i));
! 			    buf_delsign(buf->bufp, id, NULL);
  			}
  			else
  			{
--- 1251,1262 ----
  		    /* delete signs from the lines being deleted */
  		    for (i = del_from_lnum; i <= del_to_lnum; i++)
  		    {
! 			int id = buf_findsign_id(buf->bufp, (linenr_T)i, NULL);
  			if (id > 0)
  			{
  			    nbdebug(("    Deleting sign %d on line %d\n",
  								      id, i));
! 			    buf_delsign(buf->bufp, 0, id, NULL);
  			}
  			else
  			{
*** ../vim-8.1.0657/src/proto/buffer.pro	2018-12-27 00:28:27.501299292 +0100
--- src/proto/buffer.pro	2018-12-29 18:40:08.310566333 +0100
***************
*** 69,91 ****
  void switch_to_win_for_buf(buf_T *buf, win_T **save_curwinp, tabpage_T **save_curtabp, bufref_T *save_curbuf);
  void restore_win_for_buf(win_T *save_curwin, tabpage_T *save_curtab, bufref_T *save_curbuf);
  int find_win_for_buf(buf_T *buf, win_T **wp, tabpage_T **tp);
- void buf_addsign(buf_T *buf, int id, char_u *group, int prio, linenr_T lnum, int typenr);
- linenr_T buf_change_sign_type(buf_T *buf, int markId, char_u *group, int typenr);
- int buf_getsigntype(buf_T *buf, linenr_T lnum, int type);
- linenr_T buf_delsign(buf_T *buf, int id, char_u *group);
- int buf_findsign(buf_T *buf, int id, char_u *group);
- #ifdef FEAT_SIGNS
  void init_signs(void);
  int sign_group_get_next_signid(buf_T *buf, char_u *groupname);
  int sign_in_group(signlist_T *sign, char_u *group);
  dict_T *sign_get_info(signlist_T *sign);
  signlist_T *buf_getsign_with_id(buf_T *buf, int id, char_u *group);
! #endif
! int buf_findsign_id(buf_T *buf, linenr_T lnum);
  int buf_findsigntype_id(buf_T *buf, linenr_T lnum, int typenr);
  int buf_signcount(buf_T *buf, linenr_T lnum);
  void buf_delete_signs(buf_T *buf, char_u *group);
! void buf_delete_all_signs(void);
  void sign_list_placed(buf_T *rbuf, char_u *sign_group);
  void sign_mark_adjust(linenr_T line1, linenr_T line2, long amount, long amount_after);
  void set_buflisted(int on);
--- 69,89 ----
  void switch_to_win_for_buf(buf_T *buf, win_T **save_curwinp, tabpage_T **save_curtabp, bufref_T *save_curbuf);
  void restore_win_for_buf(win_T *save_curwin, tabpage_T *save_curtab, bufref_T *save_curbuf);
  int find_win_for_buf(buf_T *buf, win_T **wp, tabpage_T **tp);
  void init_signs(void);
  int sign_group_get_next_signid(buf_T *buf, char_u *groupname);
  int sign_in_group(signlist_T *sign, char_u *group);
  dict_T *sign_get_info(signlist_T *sign);
+ void buf_addsign(buf_T *buf, int id, char_u *groupname, int prio, linenr_T lnum, int typenr);
+ linenr_T buf_change_sign_type(buf_T *buf, int markId, char_u *group, int typenr);
+ int buf_getsigntype(buf_T *buf, linenr_T lnum, int type);
+ linenr_T buf_delsign(buf_T *buf, linenr_T atlnum, int id, char_u *group);
+ int buf_findsign(buf_T *buf, int id, char_u *group);
  signlist_T *buf_getsign_with_id(buf_T *buf, int id, char_u *group);
! int buf_findsign_id(buf_T *buf, linenr_T lnum, char_u *groupname);
  int buf_findsigntype_id(buf_T *buf, linenr_T lnum, int typenr);
  int buf_signcount(buf_T *buf, linenr_T lnum);
  void buf_delete_signs(buf_T *buf, char_u *group);
! void buf_delete_all_signs(char_u *groupname);
  void sign_list_placed(buf_T *rbuf, char_u *sign_group);
  void sign_mark_adjust(linenr_T line1, linenr_T line2, long amount, long amount_after);
  void set_buflisted(int on);
*** ../vim-8.1.0657/src/proto/ex_cmds.pro	2018-12-21 15:16:57.479579788 +0100
--- src/proto/ex_cmds.pro	2018-12-29 18:40:16.218495713 +0100
***************
*** 54,77 ****
  void ex_exusage(exarg_T *eap);
  void ex_viusage(exarg_T *eap);
  void ex_helptags(exarg_T *eap);
  void ex_sign(exarg_T *eap);
  void sign_gui_started(void);
  int sign_get_attr(int typenr, int line);
  char_u *sign_get_text(int typenr);
  void *sign_get_image(int typenr);
  char_u *sign_typenr2name(int typenr);
  void free_signs(void);
- void free_signs(void);
  char_u *get_sign_name(expand_T *xp, int idx);
  void set_context_in_sign_cmd(expand_T *xp, char_u *arg);
  void ex_smile(exarg_T *eap);
  void ex_drop(exarg_T *eap);
  char_u *skip_vimgrep_pat(char_u *p, char_u **s, int *flags);
  void ex_oldfiles(exarg_T *eap);
- int sign_define_by_name(char_u *name, char_u *icon, char_u *linehl, char_u *text, char_u *texthl);
- int sign_undefine_by_name(char_u *name);
- void sign_getlist(char_u *name, list_T *retlist);
- int sign_place(int *sign_id, char_u *group, char_u *sign_name, buf_T *buf, linenr_T lnum, int prio);
- int sign_unplace(int id, char_u *group, buf_T *buf);
- void sign_get_placed(buf_T *buf, linenr_T lnum, int id, char_u *group, list_T *retlist);
  /* vim: set ft=c : */
--- 54,76 ----
  void ex_exusage(exarg_T *eap);
  void ex_viusage(exarg_T *eap);
  void ex_helptags(exarg_T *eap);
+ int sign_define_by_name(char_u *name, char_u *icon, char_u *linehl, char_u *text, char_u *texthl);
+ int sign_undefine_by_name(char_u *name);
+ int sign_place(int *sign_id, char_u *sign_group, char_u *sign_name, buf_T *buf, linenr_T lnum, int prio);
+ int sign_unplace(int sign_id, char_u *sign_group, buf_T *buf, linenr_T atlnum);
  void ex_sign(exarg_T *eap);
+ void sign_getlist(char_u *name, list_T *retlist);
+ void sign_get_placed(buf_T *buf, linenr_T lnum, int sign_id, char_u *sign_group, list_T *retlist);
  void sign_gui_started(void);
  int sign_get_attr(int typenr, int line);
  char_u *sign_get_text(int typenr);
  void *sign_get_image(int typenr);
  char_u *sign_typenr2name(int typenr);
  void free_signs(void);
  char_u *get_sign_name(expand_T *xp, int idx);
  void set_context_in_sign_cmd(expand_T *xp, char_u *arg);
  void ex_smile(exarg_T *eap);
  void ex_drop(exarg_T *eap);
  char_u *skip_vimgrep_pat(char_u *p, char_u **s, int *flags);
  void ex_oldfiles(exarg_T *eap);
  /* vim: set ft=c : */
*** ../vim-8.1.0657/src/testdir/test_signs.vim	2018-12-27 00:28:27.501299292 +0100
--- src/testdir/test_signs.vim	2018-12-29 18:36:00.272781771 +0100
***************
*** 28,35 ****
    let a=execute('sign list Sign1')
    call assert_equal("\nsign Sign1 text=x ", a)
  
!   " Split the window to the bottom to verify sign jump will stay in the current window
!   " if the buffer is displayed there.
    let bn = bufnr('%')
    let wn = winnr()
    exe 'sign place 41 line=3 name=Sign1 buffer=' . bn 
--- 28,35 ----
    let a=execute('sign list Sign1')
    call assert_equal("\nsign Sign1 text=x ", a)
  
!   " Split the window to the bottom to verify sign jump will stay in the
!   " current window if the buffer is displayed there.
    let bn = bufnr('%')
    let wn = winnr()
    exe 'sign place 41 line=3 name=Sign1 buffer=' . bn 
***************
*** 211,229 ****
    call assert_equal('"sign undefine Sign1 Sign2', @:)
  
    call feedkeys(":sign place 1 \<C-A>\<C-B>\"\<CR>", 'tx')
!   call assert_equal('"sign place 1 buffer= file= line= name=', @:)
  
    call feedkeys(":sign place 1 name=\<C-A>\<C-B>\"\<CR>", 'tx')
    call assert_equal('"sign place 1 name=Sign1 Sign2', @:)
  
    call feedkeys(":sign unplace 1 \<C-A>\<C-B>\"\<CR>", 'tx')
!   call assert_equal('"sign unplace 1 buffer= file=', @:)
  
    call feedkeys(":sign list \<C-A>\<C-B>\"\<CR>", 'tx')
    call assert_equal('"sign list Sign1 Sign2', @:)
  
    call feedkeys(":sign jump 1 \<C-A>\<C-B>\"\<CR>", 'tx')
!   call assert_equal('"sign jump 1 buffer= file=', @:)
  
    sign undefine Sign1
    sign undefine Sign2
--- 211,230 ----
    call assert_equal('"sign undefine Sign1 Sign2', @:)
  
    call feedkeys(":sign place 1 \<C-A>\<C-B>\"\<CR>", 'tx')
!   call assert_equal('"sign place 1 buffer= file= group= line= name= priority=',
! 	      \ @:)
  
    call feedkeys(":sign place 1 name=\<C-A>\<C-B>\"\<CR>", 'tx')
    call assert_equal('"sign place 1 name=Sign1 Sign2', @:)
  
    call feedkeys(":sign unplace 1 \<C-A>\<C-B>\"\<CR>", 'tx')
!   call assert_equal('"sign unplace 1 buffer= file= group=', @:)
  
    call feedkeys(":sign list \<C-A>\<C-B>\"\<CR>", 'tx')
    call assert_equal('"sign list Sign1 Sign2', @:)
  
    call feedkeys(":sign jump 1 \<C-A>\<C-B>\"\<CR>", 'tx')
!   call assert_equal('"sign jump 1 buffer= file= group=', @:)
  
    sign undefine Sign1
    sign undefine Sign2
***************
*** 449,455 ****
  
    edit Xsign
    let bnum = bufnr('%')
-   let fname = fnamemodify('Xsign', ':p')
  
    " Error case
    call assert_fails("call sign_place(5, [], 'sign1', 'Xsign',
--- 450,455 ----
***************
*** 466,471 ****
--- 466,475 ----
    let s = sign_getplaced('Xsign')
    call assert_equal(1, len(s[0].signs))
    call assert_equal(s[0].signs[0].group, '')
+   let s = sign_getplaced(bnum, {'group' : ''})
+   call assert_equal([{'id' : 5, 'group' : '', 'name' : 'sign1', 'lnum' : 10,
+ 	      \ 'priority' : 10}], s[0].signs)
+   call assert_equal(1, len(s[0].signs))
    let s = sign_getplaced(bnum, {'group' : 'g2'})
    call assert_equal('g2', s[0].signs[0].group)
    let s = sign_getplaced(bnum, {'group' : 'g3'})
***************
*** 584,717 ****
    sign place 5 group=g1 line=10 name=sign1 file=Xsign
    sign place 5 group=g2 line=10 name=sign1 file=Xsign
  
!   " Test for :sign place group={group} file={fname}
    let a = execute('sign place file=Xsign')
    call assert_equal("\n--- Signs ---\nSigns for Xsign:\n    line=10  id=5  name=sign1 priority=10\n", a)
  
    let a = execute('sign place group=g2 file=Xsign')
    call assert_equal("\n--- Signs ---\nSigns for Xsign:\n    line=10  id=5  group=g2  name=sign1 priority=10\n", a)
  
    let a = execute('sign place group=* file=Xsign')
    call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" .
  	      \ "    line=10  id=5  group=g2  name=sign1 priority=10\n" .
  	      \ "    line=10  id=5  group=g1  name=sign1 priority=10\n" .
  	      \ "    line=10  id=5  name=sign1 priority=10\n", a)
  
    let a = execute('sign place group=xyz file=Xsign')
    call assert_equal("\n--- Signs ---\nSigns for Xsign:\n", a)
  
    call sign_unplace('*')
- 
-   " Test for :sign place group={group} buffer={nr}
    let bnum = bufnr('Xsign')
    exe 'sign place 5 line=10 name=sign1 buffer=' . bnum
    exe 'sign place 5 group=g1 line=11 name=sign1 buffer=' . bnum
    exe 'sign place 5 group=g2 line=12 name=sign1 buffer=' . bnum
  
    let a = execute('sign place buffer=' . bnum)
    call assert_equal("\n--- Signs ---\nSigns for Xsign:\n    line=10  id=5  name=sign1 priority=10\n", a)
  
    let a = execute('sign place group=g2 buffer=' . bnum)
    call assert_equal("\n--- Signs ---\nSigns for Xsign:\n    line=12  id=5  group=g2  name=sign1 priority=10\n", a)
  
    let a = execute('sign place group=* buffer=' . bnum)
    call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" .
  	      \ "    line=10  id=5  name=sign1 priority=10\n" .
  	      \ "    line=11  id=5  group=g1  name=sign1 priority=10\n" .
  	      \ "    line=12  id=5  group=g2  name=sign1 priority=10\n", a)
  
    let a = execute('sign place group=xyz buffer=' . bnum)
    call assert_equal("\n--- Signs ---\nSigns for Xsign:\n", a)
  
    let a = execute('sign place group=*')
    call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" .
  	      \ "    line=10  id=5  name=sign1 priority=10\n" .
  	      \ "    line=11  id=5  group=g1  name=sign1 priority=10\n" .
  	      \ "    line=12  id=5  group=g2  name=sign1 priority=10\n", a)
  
!   " Test for :sign unplace
!   sign unplace 5 group=g2 file=Xsign
!   call assert_equal([], sign_getplaced(bnum, {'group' : 'g2'})[0].signs)
! 
!   exe 'sign unplace 5 group=g1 buffer=' . bnum
!   call assert_equal([], sign_getplaced(bnum, {'group' : 'g1'})[0].signs)
! 
!   sign unplace 5 group=xy file=Xsign
!   call assert_equal(1, len(sign_getplaced(bnum, {'group' : '*'})[0].signs))
! 
!   " Test for removing all the signs. Place the signs again for this test
!   sign place 5 group=g1 line=11 name=sign1 file=Xsign
!   sign place 5 group=g2 line=12 name=sign1 file=Xsign
!   sign place 6 line=20 name=sign1 file=Xsign
!   sign place 6 group=g1 line=21 name=sign1 file=Xsign
!   sign place 6 group=g2 line=22 name=sign1 file=Xsign
!   sign unplace 5 group=* file=Xsign
!   let a = execute('sign place group=*')
!   call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" .
! 	      \ "    line=20  id=6  name=sign1 priority=10\n" .
! 	      \ "    line=21  id=6  group=g1  name=sign1 priority=10\n" .
! 	      \ "    line=22  id=6  group=g2  name=sign1 priority=10\n", a)
  
!   " Remove all the signs from the global group
!   sign unplace * file=Xsign
!   let a = execute('sign place group=*')
!   call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" .
! 	      \ "    line=21  id=6  group=g1  name=sign1 priority=10\n" .
! 	      \ "    line=22  id=6  group=g2  name=sign1 priority=10\n", a)
  
!   " Remove all the signs from a particular group
!   sign place 5 line=10 name=sign1 file=Xsign
!   sign place 5 group=g1 line=11 name=sign1 file=Xsign
!   sign place 5 group=g2 line=12 name=sign1 file=Xsign
!   sign unplace * group=g1 file=Xsign
!   let a = execute('sign place group=*')
!   call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" .
! 	      \ "    line=10  id=5  name=sign1 priority=10\n" .
! 	      \ "    line=12  id=5  group=g2  name=sign1 priority=10\n" .
! 	      \ "    line=22  id=6  group=g2  name=sign1 priority=10\n", a)
  
!   " Remove all the signs from all the groups in a file
!   sign place 5 group=g1 line=11 name=sign1 file=Xsign
!   sign place 6 line=20 name=sign1 file=Xsign
!   sign place 6 group=g1 line=21 name=sign1 file=Xsign
!   sign unplace * group=* file=Xsign
!   let a = execute('sign place group=*')
!   call assert_equal("\n--- Signs ---\n", a)
  
!   " Remove a particular sign id in a group from all the files
!   sign place 5 group=g1 line=11 name=sign1 file=Xsign
!   sign unplace 5 group=g1
!   let a = execute('sign place group=*')
!   call assert_equal("\n--- Signs ---\n", a)
  
!   " Remove a particular sign id in all the groups from all the files
!   sign place 5 line=10 name=sign1 file=Xsign
!   sign place 5 group=g1 line=11 name=sign1 file=Xsign
!   sign place 5 group=g2 line=12 name=sign1 file=Xsign
!   sign place 6 line=20 name=sign1 file=Xsign
!   sign place 6 group=g1 line=21 name=sign1 file=Xsign
!   sign place 6 group=g2 line=22 name=sign1 file=Xsign
    sign unplace 5 group=*
!   let a = execute('sign place group=*')
!   call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" .
! 	      \ "    line=20  id=6  name=sign1 priority=10\n" .
! 	      \ "    line=21  id=6  group=g1  name=sign1 priority=10\n" .
! 	      \ "    line=22  id=6  group=g2  name=sign1 priority=10\n", a)
  
!   " Remove all the signs from all the groups in all the files
!   sign place 5 line=10 name=sign1 file=Xsign
!   sign place 5 group=g1 line=11 name=sign1 file=Xsign
    sign unplace * group=*
!   let a = execute('sign place group=*')
!   call assert_equal("\n--- Signs ---\n", a)
  
!   " Error cases
!   call assert_fails("sign place 3 group= name=sign1 buffer=" . bnum, 'E474:')
  
-   call delete("Xsign")
    call sign_unplace('*')
    call sign_undefine()
    enew  | only
  endfunc
  
  " Tests for auto-generating the sign identifier
--- 588,1021 ----
    sign place 5 group=g1 line=10 name=sign1 file=Xsign
    sign place 5 group=g2 line=10 name=sign1 file=Xsign
  
!   " Tests for the ':sign place' command
! 
!   " :sign place file={fname}
    let a = execute('sign place file=Xsign')
    call assert_equal("\n--- Signs ---\nSigns for Xsign:\n    line=10  id=5  name=sign1 priority=10\n", a)
  
+   " :sign place group={group} file={fname}
    let a = execute('sign place group=g2 file=Xsign')
    call assert_equal("\n--- Signs ---\nSigns for Xsign:\n    line=10  id=5  group=g2  name=sign1 priority=10\n", a)
  
+   " :sign place group=* file={fname}
    let a = execute('sign place group=* file=Xsign')
    call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" .
  	      \ "    line=10  id=5  group=g2  name=sign1 priority=10\n" .
  	      \ "    line=10  id=5  group=g1  name=sign1 priority=10\n" .
  	      \ "    line=10  id=5  name=sign1 priority=10\n", a)
  
+   " Error case: non-existing group
    let a = execute('sign place group=xyz file=Xsign')
    call assert_equal("\n--- Signs ---\nSigns for Xsign:\n", a)
  
    call sign_unplace('*')
    let bnum = bufnr('Xsign')
    exe 'sign place 5 line=10 name=sign1 buffer=' . bnum
    exe 'sign place 5 group=g1 line=11 name=sign1 buffer=' . bnum
    exe 'sign place 5 group=g2 line=12 name=sign1 buffer=' . bnum
  
+   " :sign place buffer={fname}
    let a = execute('sign place buffer=' . bnum)
    call assert_equal("\n--- Signs ---\nSigns for Xsign:\n    line=10  id=5  name=sign1 priority=10\n", a)
  
+   " :sign place group={group} buffer={fname}
    let a = execute('sign place group=g2 buffer=' . bnum)
    call assert_equal("\n--- Signs ---\nSigns for Xsign:\n    line=12  id=5  group=g2  name=sign1 priority=10\n", a)
  
+   " :sign place group=* buffer={fname}
    let a = execute('sign place group=* buffer=' . bnum)
    call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" .
  	      \ "    line=10  id=5  name=sign1 priority=10\n" .
  	      \ "    line=11  id=5  group=g1  name=sign1 priority=10\n" .
  	      \ "    line=12  id=5  group=g2  name=sign1 priority=10\n", a)
  
+   " Error case: non-existing group
    let a = execute('sign place group=xyz buffer=' . bnum)
    call assert_equal("\n--- Signs ---\nSigns for Xsign:\n", a)
  
+   " :sign place
+   let a = execute('sign place')
+   call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" .
+ 	      \ "    line=10  id=5  name=sign1 priority=10\n", a)
+ 
+   " :sign place group={group}
+   let a = execute('sign place group=g1')
+   call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" .
+ 	      \ "    line=11  id=5  group=g1  name=sign1 priority=10\n", a)
+ 
+   " :sign place group=*
    let a = execute('sign place group=*')
    call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" .
  	      \ "    line=10  id=5  name=sign1 priority=10\n" .
  	      \ "    line=11  id=5  group=g1  name=sign1 priority=10\n" .
  	      \ "    line=12  id=5  group=g2  name=sign1 priority=10\n", a)
  
!   " Test for ':sign jump' command with groups
!   sign jump 5 group=g1 file=Xsign
!   call assert_equal(11, line('.'))
!   call assert_equal('Xsign', bufname(''))
!   sign jump 5 group=g2 file=Xsign
!   call assert_equal(12, line('.'))
  
!   " Error cases
!   call assert_fails("sign place 3 group= name=sign1 buffer=" . bnum, 'E474:')
  
!   call delete("Xsign")
!   call sign_unplace('*')
!   call sign_undefine()
!   enew  | only
! endfunc
  
! " Place signs used for ":sign unplace" command test
! func Place_signs_for_test()
!   call sign_unplace('*')
  
!   sign place 3 line=10 name=sign1 file=Xsign1
!   sign place 3 group=g1 line=11 name=sign1 file=Xsign1
!   sign place 3 group=g2 line=12 name=sign1 file=Xsign1
!   sign place 4 line=15 name=sign1 file=Xsign1
!   sign place 4 group=g1 line=16 name=sign1 file=Xsign1
!   sign place 4 group=g2 line=17 name=sign1 file=Xsign1
!   sign place 5 line=20 name=sign1 file=Xsign2
!   sign place 5 group=g1 line=21 name=sign1 file=Xsign2
!   sign place 5 group=g2 line=22 name=sign1 file=Xsign2
!   sign place 6 line=25 name=sign1 file=Xsign2
!   sign place 6 group=g1 line=26 name=sign1 file=Xsign2
!   sign place 6 group=g2 line=27 name=sign1 file=Xsign2
! endfunc
  
! " Place multiple signs in a single line for test
! func Place_signs_at_line_for_test()
!   call sign_unplace('*')
!   sign place 3 line=13 name=sign1 file=Xsign1
!   sign place 3 group=g1 line=13 name=sign1 file=Xsign1
!   sign place 3 group=g2 line=13 name=sign1 file=Xsign1
!   sign place 4 line=13 name=sign1 file=Xsign1
!   sign place 4 group=g1 line=13 name=sign1 file=Xsign1
!   sign place 4 group=g2 line=13 name=sign1 file=Xsign1
! endfunc
! 
! " Tests for the ':sign unplace' command
! func Test_sign_unplace()
!   enew | only
!   " Remove all the signs
!   call sign_unplace('*')
!   call sign_undefine()
! 
!   " Create two files and define signs
!   call writefile(repeat(["Sun is shining"], 30), "Xsign1")
!   call writefile(repeat(["It is beautiful"], 30), "Xsign2")
! 
!   let attr = {'text' : '=>', 'linehl' : 'Search', 'texthl' : 'Error'}
!   call sign_define("sign1", attr)
! 
!   edit Xsign1
!   let bnum1 = bufnr('%')
!   split Xsign2
!   let bnum2 = bufnr('%')
! 
!   let signs1 = [{'id' : 3, 'name' : 'sign1', 'lnum' : 10, 'group' : '',
! 	      \ 'priority' : 10},
! 	      \ {'id' : 3, 'name' : 'sign1', 'lnum' : 11, 'group' : 'g1',
! 	      \ 'priority' : 10},
! 	      \ {'id' : 3, 'name' : 'sign1', 'lnum' : 12, 'group' : 'g2',
! 	      \ 'priority' : 10},
! 	      \ {'id' : 4, 'name' : 'sign1', 'lnum' : 15, 'group' : '',
! 	      \ 'priority' : 10},
! 	      \ {'id' : 4, 'name' : 'sign1', 'lnum' : 16, 'group' : 'g1',
! 	      \ 'priority' : 10},
! 	      \ {'id' : 4, 'name' : 'sign1', 'lnum' : 17, 'group' : 'g2',
! 	      \ 'priority' : 10},]
!   let signs2 = [{'id' : 5, 'name' : 'sign1', 'lnum' : 20, 'group' : '',
! 	      \ 'priority' : 10},
! 	      \ {'id' : 5, 'name' : 'sign1', 'lnum' : 21, 'group' : 'g1',
! 	      \ 'priority' : 10},
! 	      \ {'id' : 5, 'name' : 'sign1', 'lnum' : 22, 'group' : 'g2',
! 	      \ 'priority' : 10},
! 	      \ {'id' : 6, 'name' : 'sign1', 'lnum' : 25, 'group' : '',
! 	      \ 'priority' : 10},
! 	      \ {'id' : 6, 'name' : 'sign1', 'lnum' : 26, 'group' : 'g1',
! 	      \ 'priority' : 10},
! 	      \ {'id' : 6, 'name' : 'sign1', 'lnum' : 27, 'group' : 'g2',
! 	      \ 'priority' : 10},]
! 
!   " Test for :sign unplace {id} file={fname}
!   call Place_signs_for_test()
!   sign unplace 3 file=Xsign1
!   sign unplace 6 file=Xsign2
!   call assert_equal(
! 	      \ filter(copy(signs1),
! 	      \     {idx, val -> val.id != 3 || val.group != ''}),
! 	      \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs)
!   call assert_equal(
! 	      \ filter(copy(signs2),
! 	      \     {idx, val -> val.id != 6 || val.group != ''}),
! 	      \ sign_getplaced('Xsign2', {'group' : '*'})[0].signs)
! 
!   " Test for :sign unplace {id} group={group} file={fname}
!   call Place_signs_for_test()
!   sign unplace 4 group=g1 file=Xsign1
!   sign unplace 5 group=g2 file=Xsign2
!   call assert_equal(
! 	      \ filter(copy(signs1),
! 	      \     {idx, val -> val.id != 4 || val.group != 'g1'}),
! 	      \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs)
!   call assert_equal(
! 	      \ filter(copy(signs2),
! 	      \     {idx, val -> val.id != 5 || val.group != 'g2'}),
! 	      \ sign_getplaced('Xsign2', {'group' : '*'})[0].signs)
! 
!   " Test for :sign unplace {id} group=* file={fname}
!   call Place_signs_for_test()
!   sign unplace 3 group=* file=Xsign1
!   sign unplace 6 group=* file=Xsign2
!   call assert_equal(
! 	      \ filter(copy(signs1),
! 	      \     {idx, val -> val.id != 3}),
! 	      \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs)
!   call assert_equal(
! 	      \ filter(copy(signs2),
! 	      \     {idx, val -> val.id != 6}),
! 	      \ sign_getplaced('Xsign2', {'group' : '*'})[0].signs)
! 
!   " Test for :sign unplace * file={fname}
!   call Place_signs_for_test()
!   sign unplace * file=Xsign1
!   call assert_equal(
! 	      \ filter(copy(signs1),
! 	      \     {idx, val -> val.group != ''}),
! 	      \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs)
!   call assert_equal(signs2, sign_getplaced('Xsign2', {'group' : '*'})[0].signs)
! 
!   " Test for :sign unplace * group={group} file={fname}
!   call Place_signs_for_test()
!   sign unplace * group=g1 file=Xsign1
!   sign unplace * group=g2 file=Xsign2
!   call assert_equal(
! 	      \ filter(copy(signs1),
! 	      \     {idx, val -> val.group != 'g1'}),
! 	      \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs)
!   call assert_equal(
! 	      \ filter(copy(signs2),
! 	      \     {idx, val -> val.group != 'g2'}),
! 	      \ sign_getplaced('Xsign2', {'group' : '*'})[0].signs)
! 
!   " Test for :sign unplace * group=* file={fname}
!   call Place_signs_for_test()
!   sign unplace * group=* file=Xsign2
!   call assert_equal(signs1, sign_getplaced('Xsign1', {'group' : '*'})[0].signs)
!   call assert_equal([], sign_getplaced('Xsign2', {'group' : '*'})[0].signs)
! 
!   " Test for :sign unplace {id} buffer={nr}
!   call Place_signs_for_test()
!   exe 'sign unplace 3 buffer=' . bnum1
!   exe 'sign unplace 6 buffer=' . bnum2
!   call assert_equal(
! 	      \ filter(copy(signs1),
! 	      \     {idx, val -> val.id != 3 || val.group != ''}),
! 	      \ sign_getplaced(bnum1, {'group' : '*'})[0].signs)
!   call assert_equal(
! 	      \ filter(copy(signs2),
! 	      \     {idx, val -> val.id != 6 || val.group != ''}),
! 	      \ sign_getplaced(bnum2, {'group' : '*'})[0].signs)
! 
!   " Test for :sign unplace {id} group={group} buffer={nr}
!   call Place_signs_for_test()
!   exe 'sign unplace 4 group=g1 buffer=' . bnum1
!   exe 'sign unplace 5 group=g2 buffer=' . bnum2
!   call assert_equal(
! 	      \ filter(copy(signs1),
! 	      \     {idx, val -> val.id != 4 || val.group != 'g1'}),
! 	      \ sign_getplaced(bnum1, {'group' : '*'})[0].signs)
!   call assert_equal(
! 	      \ filter(copy(signs2),
! 	      \     {idx, val -> val.id != 5 || val.group != 'g2'}),
! 	      \ sign_getplaced(bnum2, {'group' : '*'})[0].signs)
! 
!   " Test for :sign unplace {id} group=* buffer={nr}
!   call Place_signs_for_test()
!   exe 'sign unplace 3 group=* buffer=' . bnum1
!   exe 'sign unplace 6 group=* buffer=' . bnum2
!   call assert_equal(
! 	      \ filter(copy(signs1),
! 	      \     {idx, val -> val.id != 3}),
! 	      \ sign_getplaced(bnum1, {'group' : '*'})[0].signs)
!   call assert_equal(
! 	      \ filter(copy(signs2),
! 	      \     {idx, val -> val.id != 6}),
! 	      \ sign_getplaced(bnum2, {'group' : '*'})[0].signs)
! 
!   " Test for :sign unplace * buffer={nr}
!   call Place_signs_for_test()
!   exe 'sign unplace * buffer=' . bnum1
!   call assert_equal(
! 	      \ filter(copy(signs1),
! 	      \     {idx, val -> val.group != ''}),
! 	      \ sign_getplaced(bnum1, {'group' : '*'})[0].signs)
!   call assert_equal(signs2, sign_getplaced(bnum2, {'group' : '*'})[0].signs)
! 
!   " Test for :sign unplace * group={group} buffer={nr}
!   call Place_signs_for_test()
!   exe 'sign unplace * group=g1 buffer=' . bnum1
!   exe 'sign unplace * group=g2 buffer=' . bnum2
!   call assert_equal(
! 	      \ filter(copy(signs1),
! 	      \     {idx, val -> val.group != 'g1'}),
! 	      \ sign_getplaced(bnum1, {'group' : '*'})[0].signs)
!   call assert_equal(
! 	      \ filter(copy(signs2),
! 	      \     {idx, val -> val.group != 'g2'}),
! 	      \ sign_getplaced(bnum2, {'group' : '*'})[0].signs)
! 
!   " Test for :sign unplace * group=* buffer={nr}
!   call Place_signs_for_test()
!   exe 'sign unplace * group=* buffer=' . bnum2
!   call assert_equal(signs1, sign_getplaced(bnum1, {'group' : '*'})[0].signs)
!   call assert_equal([], sign_getplaced(bnum2, {'group' : '*'})[0].signs)
! 
!   " Test for :sign unplace {id}
!   call Place_signs_for_test()
!   sign unplace 4
!   sign unplace 6
!   call assert_equal(
! 	      \ filter(copy(signs1),
! 	      \     {idx, val -> val.id != 4 || val.group != ''}),
! 	      \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs)
!   call assert_equal(
! 	      \ filter(copy(signs2),
! 	      \     {idx, val -> val.id != 6 || val.group != ''}),
! 	      \ sign_getplaced('Xsign2', {'group' : '*'})[0].signs)
! 
!   " Test for :sign unplace {id} group={group}
!   call Place_signs_for_test()
!   sign unplace 4 group=g1
!   sign unplace 6 group=g2
!   call assert_equal(
! 	      \ filter(copy(signs1),
! 	      \     {idx, val -> val.id != 4 || val.group != 'g1'}),
! 	      \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs)
!   call assert_equal(
! 	      \ filter(copy(signs2),
! 	      \     {idx, val -> val.id != 6 || val.group != 'g2'}),
! 	      \ sign_getplaced('Xsign2', {'group' : '*'})[0].signs)
! 
!   " Test for :sign unplace {id} group=*
!   call Place_signs_for_test()
!   sign unplace 3 group=*
    sign unplace 5 group=*
!   call assert_equal(
! 	      \ filter(copy(signs1),
! 	      \     {idx, val -> val.id != 3}),
! 	      \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs)
!   call assert_equal(
! 	      \ filter(copy(signs2),
! 	      \     {idx, val -> val.id != 5}),
! 	      \ sign_getplaced('Xsign2', {'group' : '*'})[0].signs)
  
!   " Test for :sign unplace *
!   call Place_signs_for_test()
!   sign unplace *
!   call assert_equal(
! 	      \ filter(copy(signs1),
! 	      \     {idx, val -> val.group != ''}),
! 	      \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs)
!   call assert_equal(
! 	      \ filter(copy(signs2),
! 	      \     {idx, val -> val.group != ''}),
! 	      \ sign_getplaced('Xsign2', {'group' : '*'})[0].signs)
! 
!   " Test for :sign unplace * group={group}
!   call Place_signs_for_test()
!   sign unplace * group=g1
!   call assert_equal(
! 	      \ filter(copy(signs1),
! 	      \     {idx, val -> val.group != 'g1'}),
! 	      \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs)
!   call assert_equal(
! 	      \ filter(copy(signs2),
! 	      \     {idx, val -> val.group != 'g1'}),
! 	      \ sign_getplaced('Xsign2', {'group' : '*'})[0].signs)
! 
!   " Test for :sign unplace * group=*
!   call Place_signs_for_test()
    sign unplace * group=*
!   call assert_equal([], sign_getplaced('Xsign1', {'group' : '*'})[0].signs)
!   call assert_equal([], sign_getplaced('Xsign2', {'group' : '*'})[0].signs)
  
!   " Negative test cases
!   call Place_signs_for_test()
!   sign unplace 3 group=xy file=Xsign1
!   sign unplace * group=xy file=Xsign1
!   silent! sign unplace * group=* file=FileNotPresent
!   call assert_equal(signs1, sign_getplaced('Xsign1', {'group' : '*'})[0].signs)
!   call assert_equal(signs2, sign_getplaced('Xsign2', {'group' : '*'})[0].signs)
! 
!   " Tests for removing sign at the current cursor position
! 
!   " Test for ':sign unplace'
!   let signs1 = [{'id' : 4, 'name' : 'sign1', 'lnum' : 13, 'group' : 'g2',
! 	      \ 'priority' : 10},
! 	      \ {'id' : 4, 'name' : 'sign1', 'lnum' : 13, 'group' : 'g1',
! 	      \ 'priority' : 10},
! 	      \ {'id' : 4, 'name' : 'sign1', 'lnum' : 13, 'group' : '',
! 	      \ 'priority' : 10},
! 	      \ {'id' : 3, 'name' : 'sign1', 'lnum' : 13, 'group' : 'g2',
! 	      \ 'priority' : 10},
! 	      \ {'id' : 3, 'name' : 'sign1', 'lnum' : 13, 'group' : 'g1',
! 	      \ 'priority' : 10},
! 	      \ {'id' : 3, 'name' : 'sign1', 'lnum' : 13, 'group' : '',
! 	      \ 'priority' : 10},]
!   exe bufwinnr('Xsign1') . 'wincmd w'
!   call cursor(13, 1)
! 
!   " Should remove only one sign in the global group
!   call Place_signs_at_line_for_test()
!   sign unplace
!   call assert_equal(
! 	      \ filter(copy(signs1),
! 	      \     {idx, val -> val.id != 4 || val.group != ''}),
! 	      \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs)
!   " Should remove the second sign in the global group
!   sign unplace
!   call assert_equal(
! 	      \ filter(copy(signs1),
! 	      \     {idx, val -> val.group != ''}),
! 	      \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs)
! 
!   " Test for ':sign unplace group={group}'
!   call Place_signs_at_line_for_test()
!   " Should remove only one sign in group g1
!   sign unplace group=g1
!   call assert_equal(
! 	      \ filter(copy(signs1),
! 	      \     {idx, val -> val.id != 4 || val.group != 'g1'}),
! 	      \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs)
!   sign unplace group=g2
!   call assert_equal(
! 	      \ filter(copy(signs1),
! 	      \     {idx, val -> val.id != 4 || val.group == ''}),
! 	      \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs)
! 
!   " Test for ':sign unplace group=*'
!   call Place_signs_at_line_for_test()
!   sign unplace group=*
!   sign unplace group=*
!   sign unplace group=*
!   call assert_equal(
! 	      \ filter(copy(signs1),
! 	      \     {idx, val -> val.id != 4}),
! 	      \ sign_getplaced('Xsign1', {'group' : '*'})[0].signs)
!   sign unplace group=*
!   sign unplace group=*
!   sign unplace group=*
!   call assert_equal([], sign_getplaced('Xsign1', {'group' : '*'})[0].signs)
  
    call sign_unplace('*')
    call sign_undefine()
    enew  | only
+   call delete("Xsign1")
+   call delete("Xsign2")
  endfunc
  
  " Tests for auto-generating the sign identifier
***************
*** 762,768 ****
    " Place three signs with different priority in the same line
    call writefile(repeat(["Sun is shining"], 30), "Xsign")
    edit Xsign
-   let fname = fnamemodify('Xsign', ':p')
  
    call sign_place(1, 'g1', 'sign1', 'Xsign',
  	      \ {'lnum' : 11, 'priority' : 50})
--- 1066,1071 ----
*** ../vim-8.1.0657/src/version.c	2018-12-29 13:09:43.242347695 +0100
--- src/version.c	2018-12-29 18:51:45.504342343 +0100
***************
*** 801,802 ****
--- 801,804 ----
  {   /* Add new patch number below this line */
+ /**/
+     658,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
76. Your ISP regards you as a business partner rather than as a customer.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///