From 06be4c5956248021192e549d05aea066b5d2f13b Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Sun, 5 Feb 2023 14:35:40 -0500 Subject: Fix what went wrong, part 1 --- input.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'input.c') 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) { -- cgit 1.4.1