From 14a6486b9b2b9522982cde12c05b20931fe34999 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Sat, 30 Jul 2022 18:47:26 -0400 Subject: Switch to cache interfaces --- input.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'input.c') diff --git a/input.c b/input.c index 87a4eb9..739d889 100644 --- a/input.c +++ b/input.c @@ -261,12 +261,12 @@ static const struct { { L"\\wave", L"ヾ(^∇^)" }, }; -void inputCompleteAdd(void) { +void inputCache(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); - completeAdd(None, mbs, Default); + cacheInsert(false, None, mbs); } } @@ -296,15 +296,16 @@ static struct { size_t pos; size_t len; bool suffix; + struct Cursor curs; } tab; static void tabAccept(void) { - completeAccept(); + cacheAccept(&tab.curs); tab.len = 0; } static void tabReject(void) { - completeReject(); + cacheReject(&tab.curs); tab.len = 0; } @@ -332,9 +333,9 @@ static int tabComplete(struct Edit *e, uint id) { tab.suffix = true; } - const char *comp = complete(id, tab.pre); + const char *comp = cachePrefix(&tab.curs, id, tab.pre); if (!comp) { - comp = complete(id, tab.pre); + comp = cachePrefix(&tab.curs, id, tab.pre); tab.suffix ^= true; } if (!comp) { -- cgit 1.4.1 bc581ec744'>tree commit diff
path: root/Makefile (unfollow)
Commit message (Expand)Author
2018-08-08Use BLACK LEFT-POINTING TRIANGLE for markerJune McEnroe
2018-08-07Reset attrs after addIRCJune McEnroe
2018-08-07Add tab complete UIJune McEnroe
2018-08-07Implement cycling tab completeJune McEnroe
2018-08-07Mark log when scrolling upJune McEnroe
2018-08-07Remove extraneous slash from unrecognized commandJune McEnroe
2018-08-07Highlight and beep pingsJune McEnroe
2018-08-07Factor out allocating conversion between wcs and mbsJune McEnroe
2018-08-07Match commands case-insensitivelyJune McEnroe
2018-08-07Convert input to multibyte before handlingJune McEnroe
2018-08-07Populate tab-complete listJune McEnroe
2018-08-07Fix /me formatting side-effectsJune McEnroe
2018-08-07Define ui.c BUF_LEN with enumJune McEnroe
2018-08-07Hack clang into checking uiFmt format stringsJune McEnroe
2018-08-07Handle PART and QUIT without messagesJune McEnroe
2018-08-07Make safe filling the who bufferJune McEnroe
2018-08-07Add reverse and reset IRC formatting codesJune McEnroe
2018-08-06Rewrite line editing again, add formattingJune McEnroe
2018-08-06Fix allocation size in vaswprintfJune McEnroe
2018-08-06Implement word wrappingJune McEnroe
2018-08-06Use wchar_t strings for all of UIJune McEnroe
2018-08-06Rename line editing functionsJune McEnroe
2018-08-05Initialize all possible color pairsJune McEnroe
2018-08-05Refactor color initializationJune McEnroe
2018-08-05Add ^L redrawJune McEnroe
2018-08-05Use 16 colors if availableJune McEnroe
2018-08-05Limit parsed colors to number of mIRC colorsJune McEnroe
2018-08-04Show source link on exitJune McEnroe
2018-08-04Implement line editing, scrollingJune McEnroe
2018-08-04Handle /topicJune McEnroe