diff options
author | Michael Vetter <jubalh@iodoru.org> | 2022-10-17 16:53:58 +0200 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2022-10-17 16:53:58 +0200 |
commit | 65aff65596561424c5d85a78114a54c1f98b4529 (patch) | |
tree | fd4ac5cdc4bc7e4e5a786fbf624b3386ed01086e | |
parent | 528acfb7161db6b38bd273e08ba4924beafe578d (diff) | |
download | profani-tty-65aff65596561424c5d85a78114a54c1f98b4529.tar.gz |
Improve /msg and /win autocompletion
Let /win and /msg both autocomplete roster nickname and actual barejid
-rw-r--r-- | src/command/cmd_ac.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c index 9dc855de..1ee0c15c 100644 --- a/src/command/cmd_ac.c +++ b/src/command/cmd_ac.c @@ -1836,6 +1836,11 @@ _cmd_ac_complete_params(ProfWin* window, const char* const input, gboolean previ free(unquoted); return result; } + result = autocomplete_param_with_func(unquoted, contact_choices[i], roster_barejid_autocomplete, previous, NULL); + if (result) { + free(unquoted); + return result; + } } free(unquoted); @@ -3668,7 +3673,16 @@ _console_autocomplete(ProfWin* window, const char* const input, gboolean previou static char* _win_autocomplete(ProfWin* window, const char* const input, gboolean previous) { - return autocomplete_param_with_func(input, "/win", win_autocomplete, previous, NULL); + char* result = autocomplete_param_with_func(input, "/win", win_autocomplete, previous, NULL); + + if (result) { + return result; + } + + char* unquoted = strip_arg_quotes(input); + result = autocomplete_param_with_func(unquoted, "/win", roster_contact_autocomplete, previous, NULL); + free(unquoted); + return result; } static char* |