summary refs log tree commit diff
path: root/input.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2023-02-05 14:35:40 -0500
committerJune McEnroe <june@causal.agency>2023-02-05 19:28:36 -0500
commit06be4c5956248021192e549d05aea066b5d2f13b (patch)
tree43accf040a26199bf42fb1fcbd48ea91df41a8d8 /input.c
parentFlatten cache structs (diff)
downloadcatgirl-06be4c5956248021192e549d05aea066b5d2f13b.tar.gz
catgirl-06be4c5956248021192e549d05aea066b5d2f13b.zip
Fix what went wrong, part 1
Diffstat (limited to '')
-rw-r--r--input.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/input.c b/input.c
index 15f733d..b11fc22 100644
--- a/input.c
+++ b/input.c
@@ -261,12 +261,12 @@ static const struct {
 	{ L"\\wave", L"ヾ(^∇^)" },
 };
 
-void inputCache(void) {
+void inputCompletion(void) {
 	char mbs[256];
 	for (size_t i = 0; i < ARRAY_LEN(Macros); ++i) {
 		size_t n = wcstombs(mbs, Macros[i].name, sizeof(mbs));
 		assert(n != (size_t)-1);
-		cacheInsert(false, None, mbs);
+		completePush(None, mbs);
 	}
 }
 
@@ -300,13 +300,12 @@ static struct {
 } tab;
 
 static void tabAccept(void) {
-	cacheTouch(&tab.curs);
-	tab.curs = (struct Cursor) {0};
+	completeAccept(&tab.curs);
 	tab.len = 0;
 }
 
 static void tabReject(void) {
-	tab.curs = (struct Cursor) {0};
+	completeReject(&tab.curs);
 	tab.len = 0;
 }
 
@@ -334,9 +333,9 @@ static int tabComplete(struct Edit *e, uint id) {
 		tab.suffix = true;
 	}
 
-	const char *comp = cacheComplete(&tab.curs, id, tab.pre);
+	const char *comp = completePrefix(&tab.curs, id, tab.pre);
 	if (!comp) {
-		comp = cacheComplete(&tab.curs, id, tab.pre);
+		comp = completePrefix(&tab.curs, id, tab.pre);
 		tab.suffix ^= true;
 	}
 	if (!comp) {