From 88b16491956f0a882cc61fffa6a76d469006a87d Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Sun, 25 Nov 2018 14:16:08 +0100 Subject: [PATCH] add keep_word setting to completion --- src/fe-common/core/completion.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/fe-common/core/completion.c b/src/fe-common/core/completion.c index fd452e5c..2bc65d42 100644 --- a/src/fe-common/core/completion.c +++ b/src/fe-common/core/completion.c @@ -240,6 +240,10 @@ char *word_complete(WINDOW_REC *window, const char *line, int *pos, int erase, i /* Remove all nulls (from the signal) before doing further processing */ complist = g_list_remove_all(g_list_first(complist), NULL); } + + if (settings_get_bool("completion_keep_word") && complist != NULL) { + complist = g_list_append(complist, g_strdup(word)); + } } g_free(linestart); @@ -897,6 +901,7 @@ void completion_init(void) chat_completion_init(); + settings_add_bool("completion", "completion_keep_word", TRUE); command_bind("completion", NULL, (SIGNAL_FUNC) cmd_completion); signal_add_first("complete word", (SIGNAL_FUNC) sig_complete_word);