hirc

IRC client
Log | Files | Refs

commit e70d313e6a91886c2e96d23cb650b6768d55e261
parent bf976f8f772551ab7c8a083fcedf1570e79ed850
Author: hhvn <dev@hhvn.uk>
Date:   Sun, 20 Mar 2022 18:07:17 +0000

Insert completion.hchar

Diffstat:
Msrc/ui.c | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/ui.c b/src/ui.c @@ -596,7 +596,7 @@ ui_complete(wchar_t *str, size_t size) { wchar_t *cmd; size_t tokn, i, j, len; wchar_t *wp, *dup, *save; - char *found = NULL, *p; + char *found = NULL, *p, *hchar; int ctok = -1, rcnt = -1; /* toks[ctok] + rcnt == char before cursor */ unsigned coff = 0; /* str + coff == input.string */ int fullcomplete = 1; @@ -736,6 +736,14 @@ getcmd: free(stem); if (found) { + if (ctok == 0) { + hchar = config_gets("completion.hchar"); + len = strlen(found) + strlen(hchar) + 1; + p = emalloc(len); + snprintf(p, len, "%s%s", found, hchar); + free(found); + found = p; + } wp = stowc(found); ui_complete_stitch(str, size, &input.counter, coff, toks, ctok,