diff options
author | Curtis McEnroe | 2018-08-08 16:59:26 -0400 |
---|---|---|
committer | Curtis McEnroe | 2018-08-08 16:59:26 -0400 |
commit | eac0f83efa3d6b1db2715c21d60b170a546ebc0a (patch) | |
tree | c8db1326e24716e29d3c9b06e42527178d030fa1 /tab.c | |
parent | b66c8abf707e6574f6867b646dfb2549a5a7147f (diff) |
Factor out line editing to edit.c
Diffstat (limited to 'tab.c')
-rw-r--r-- | tab.c | 6 |
1 files changed, 3 insertions, 3 deletions
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); |