From eac0f83efa3d6b1db2715c21d60b170a546ebc0a Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Wed, 8 Aug 2018 16:59:26 -0400 Subject: Factor out line editing to edit.c --- tab.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tab.c') diff --git a/tab.c b/tab.c index 45670ad..a9ddfe5 100644 --- a/tab.c +++ b/tab.c @@ -34,7 +34,7 @@ static void prepend(struct Entry *entry) { head = entry; } -static void remove(struct Entry *entry) { +static void unlink(struct Entry *entry) { if (entry->prev) entry->prev->next = entry->next; if (entry->next) entry->next->prev = entry->prev; if (head == entry) head = entry->next; @@ -42,7 +42,7 @@ static void remove(struct Entry *entry) { static void touch(struct Entry *entry) { if (head == entry) return; - remove(entry); + unlink(entry); prepend(entry); } @@ -70,7 +70,7 @@ static struct Entry *match; void tabRemove(const char *word) { for (struct Entry *entry = head; entry; entry = entry->next) { if (strcmp(entry->word, word)) continue; - remove(entry); + unlink(entry); if (match == entry) match = entry->next; free(entry->word); free(entry); -- cgit 1.4.1-2-gfad0