about summary refs log tree commit diff
path: root/complete.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--complete.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/complete.c b/complete.c
index 8247149..5067512 100644
--- a/complete.c
+++ b/complete.c
@@ -109,3 +109,16 @@ void completeAccept(void) {
 void completeReject(void) {
 	match = NULL;
 }
+
+void completeRemove(size_t id, const char *str) {
+	struct Node *next = NULL;
+	for (struct Node *node = head; node; node = next) {
+		next = node->next;
+		if (id && node->id != id) continue;
+		if (strcmp(node->str, str)) continue;
+		if (match == node) match = NULL;
+		detach(node);
+		free(node->str);
+		free(node);
+	}
+}