From 1627a0c7e0f744914017cdb32313cf96944a1036 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lasse=20K=C3=A4rkk=C3=A4inen?= Date: Wed, 22 May 2019 13:40:26 +0300 Subject: [PATCH] Implement social media style @nick completion. Autocomplete "@nick " instead of traditional IRC style "nick: " enabled by /set completion_char @. Use nick as usual. --- src/fe-common/core/chat-completion.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fe-common/core/chat-completion.c b/src/fe-common/core/chat-completion.c index 144ed0f4..4318a9fd 100644 --- a/src/fe-common/core/chat-completion.c +++ b/src/fe-common/core/chat-completion.c @@ -378,7 +378,8 @@ static void complete_from_nicklist(GList **outlist, CHANNEL_REC *channel, : g_ascii_strncasecmp(rec->nick, nick, len)) == 0 && (match_case? glist_find_string(*outlist, rec->nick) : glist_find_icase_string(*outlist, rec->nick)) == NULL) { - str = g_strconcat(rec->nick, suffix, NULL); + /* use twitter style @nick if completion_char is '@', otherwise completion_char goes after nick */ + str = *suffix == '@' ? g_strconcat(suffix, rec->nick, NULL) : g_strconcat(rec->nick, suffix, NULL); if (completion_lowercase) ascii_strdown(str); if (rec->own) ownlist = g_list_append(ownlist, str);