summaryrefslogtreecommitdiffstats
path: root/src/arglist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arglist.c')
-rw-r--r--src/arglist.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/arglist.c b/src/arglist.c
index af8ce740fc..90ee4796b8 100644
--- a/src/arglist.c
+++ b/src/arglist.c
@@ -759,6 +759,33 @@ ex_next(exarg_T *eap)
}
/*
+ * ":argdedupe"
+ */
+ void
+ex_argdedupe(exarg_T *eap UNUSED)
+{
+ int i;
+ int j;
+
+ for (i = 0; i < ARGCOUNT; ++i)
+ for (j = i + 1; j < ARGCOUNT; ++j)
+ if (fnamecmp(ARGLIST[i].ae_fname, ARGLIST[j].ae_fname) == 0)
+ {
+ vim_free(ARGLIST[j].ae_fname);
+ mch_memmove(ARGLIST + j, ARGLIST + j + 1,
+ (ARGCOUNT - j - 1) * sizeof(aentry_T));
+ --ARGCOUNT;
+
+ if (curwin->w_arg_idx == j)
+ curwin->w_arg_idx = i;
+ else if (curwin->w_arg_idx > j)
+ --curwin->w_arg_idx;
+
+ --j;
+ }
+}
+
+/*
* ":argedit"
*/
void