summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2012-07-10 15:18:22 +0200
committerBram Moolenaar <Bram@vim.org>2012-07-10 15:18:22 +0200
commitf65e5667dfd0281fa197638ab3361f0bc007fc14 (patch)
treebf30002816e3ce93b5df064562eac9d856218119
parent773c1ef81b2d29e40592cd2743a7d7a6e554e06f (diff)
downloadvim-git-f65e5667dfd0281fa197638ab3361f0bc007fc14.tar.gz
updated for version 7.3.596v7.3.596
Problem: Can't remove all signs for a file or buffer. Solution: Support "*" for the sign id. (Christian Brabandt)
-rw-r--r--runtime/doc/sign.txt8
-rw-r--r--src/buffer.c3
-rw-r--r--src/ex_cmds.c20
-rw-r--r--src/proto/buffer.pro1
-rw-r--r--src/version.c2
5 files changed, 29 insertions, 5 deletions
diff --git a/runtime/doc/sign.txt b/runtime/doc/sign.txt
index 9771fbdc7..cedd96e08 100644
--- a/runtime/doc/sign.txt
+++ b/runtime/doc/sign.txt
@@ -153,8 +153,14 @@ REMOVING SIGNS *:sign-unplace* *E159*
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
diff --git a/src/buffer.c b/src/buffer.c
index ba4692a59..d6d039f0e 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -57,7 +57,6 @@ static void clear_wininfo __ARGS((buf_T *buf));
#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)
@@ -5537,7 +5536,7 @@ buf_signcount(buf, lnum)
/*
* Delete signs in buffer "buf".
*/
- static void
+ void
buf_delete_signs(buf)
buf_T *buf;
{
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index a17b40cb6..01e820dd6 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -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);
}
diff --git a/src/proto/buffer.pro b/src/proto/buffer.pro
index 23957124d..411c5af57 100644
--- a/src/proto/buffer.pro
+++ b/src/proto/buffer.pro
@@ -60,6 +60,7 @@ int buf_findsign __ARGS((buf_T *buf, int id));
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));
diff --git a/src/version.c b/src/version.c
index e4e90660a..80abb73ee 100644
--- a/src/version.c
+++ b/src/version.c
@@ -715,6 +715,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 596,
+/**/
595,
/**/
594,