Problem: Can't remove all signs for a file or buffer.
Solution: Support "*" for the sign id. (Christian Brabandt)
Remove the previously placed sign {id} from file {fname}.
See remark above about {fname} |:sign-fname|.
+:sign unplace * file={fname}
+ Remove all placed signs in file {fname}.
+
:sign unplace {id} buffer={nr}
- Same, but use buffer {nr}.
+ Remove the previously placed sign {id} from buffer {nr}.
+
+:sign unplace * buffer={nr}
+ Remove all placed signs in buffer {nr}.
:sign unplace {id}
Remove the previously placed sign {id} from all files it
#if defined(FEAT_SIGNS)
static void insert_sign __ARGS((buf_T *buf, signlist_T *prev, signlist_T *next, int id, linenr_T lnum, int typenr));
-static void buf_delete_signs __ARGS((buf_T *buf));
#endif
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
/*
* Delete signs in buffer "buf".
*/
- static void
+ void
buf_delete_signs(buf)
buf_T *buf;
{
lnum = atoi((char *)arg);
arg = skiptowhite(arg);
}
+ else if (STRNCMP(arg, "*", 1) == 0 && idx == SIGNCMD_UNPLACE)
+ {
+ if (id != -1)
+ {
+ EMSG(_(e_invarg));
+ return;
+ }
+ id = -2;
+ arg = skiptowhite(arg + 1);
+ }
else if (STRNCMP(arg, "name=", 5) == 0)
{
arg += 5;
{
EMSG2(_("E158: Invalid buffer name: %s"), arg);
}
- else if (id <= 0)
+ else if (id <= 0 && !(idx == SIGNCMD_UNPLACE && id == -2))
{
if (lnum >= 0 || sign_name != NULL)
EMSG(_(e_invarg));
}
else if (idx == SIGNCMD_UNPLACE)
{
- /* ":sign unplace {id} file={fname}" */
if (lnum >= 0 || sign_name != NULL)
EMSG(_(e_invarg));
+ else if (id == -2)
+ {
+ /* ":sign unplace * file={fname}" */
+ redraw_buf_later(buf, NOT_VALID);
+ buf_delete_signs(buf);
+ }
else
{
+ /* ":sign unplace {id} file={fname}" */
lnum = buf_delsign(buf, id);
update_debug_sign(buf, lnum);
}
int buf_findsign_id __ARGS((buf_T *buf, linenr_T lnum));
int buf_findsigntype_id __ARGS((buf_T *buf, linenr_T lnum, int typenr));
int buf_signcount __ARGS((buf_T *buf, linenr_T lnum));
+void buf_delete_signs __ARGS((buf_T *buf));
void buf_delete_all_signs __ARGS((void));
void sign_list_placed __ARGS((buf_T *rbuf));
void sign_mark_adjust __ARGS((linenr_T line1, linenr_T line2, long amount, long amount_after));
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 596,
/**/
595,
/**/