mirror of
https://github.com/irssi/irssi.git
synced 2026-08-23 10:32:31 +02:00
Improve /topic completion.
Currently, /topic completion sometimes does not work as intended, so this patch introduces completion of a topic by the beginning of text. So if a channel has topic `example` then command `/topic ex<tab>` is replaced with the full topic, but the input `/topic ot<tab>` is not completed for sure.
This commit is contained in:
parent
c26a634fe6
commit
219244f536
1 changed files with 4 additions and 2 deletions
|
|
@ -846,13 +846,15 @@ static void sig_complete_topic(GList **list, WINDOW_REC *window,
|
|||
int *want_space)
|
||||
{
|
||||
const char *topic;
|
||||
int wordlen;
|
||||
|
||||
g_return_if_fail(list != NULL);
|
||||
g_return_if_fail(word != NULL);
|
||||
|
||||
if (*word == '\0' && IS_CHANNEL(window->active)) {
|
||||
if (IS_CHANNEL(window->active)) {
|
||||
topic = CHANNEL(window->active)->topic;
|
||||
if (topic != NULL) {
|
||||
wordlen = strlen(word);
|
||||
if (topic != NULL && strncmp(topic, word, wordlen) == 0) {
|
||||
*list = g_list_append(NULL, g_strdup(topic));
|
||||
signal_stop();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue