0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

updated for version 7.3.596

Problem:    Can't remove all signs for a file or buffer.
Solution:   Support "*" for the sign id. (Christian Brabandt)
This commit is contained in:
Bram Moolenaar
2012-07-10 15:18:22 +02:00
parent 773c1ef81b
commit f65e5667df
5 changed files with 29 additions and 5 deletions

View File

@@ -6997,6 +6997,16 @@ ex_sign(eap)
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;
@@ -7033,7 +7043,7 @@ ex_sign(eap)
{
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));
@@ -7074,11 +7084,17 @@ ex_sign(eap)
}
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);
}