summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common/completion.c4
-rw-r--r--src/common/completion.h1
-rw-r--r--weechat/src/common/completion.c4
-rw-r--r--weechat/src/common/completion.h1
4 files changed, 8 insertions, 2 deletions
diff --git a/src/common/completion.c b/src/common/completion.c
index a09cfd51b..55c4932d4 100644
--- a/src/common/completion.c
+++ b/src/common/completion.c
@@ -52,6 +52,7 @@ completion_init (t_completion *completion, void *server, void *channel)
completion->context = COMPLETION_NULL;
completion->base_command = NULL;
completion->base_command_arg = 0;
+ completion->arg_is_nick = 0;
completion->position = -1;
completion->base_word = NULL;
completion->args = NULL;
@@ -351,6 +352,7 @@ completion_list_add_channel_nicks (t_completion *completion)
&completion->last_completion,
((t_irc_channel *)(completion->channel))->name);
}
+ completion->arg_is_nick = 1;
}
}
@@ -1135,7 +1137,7 @@ completion_search (t_completion *completion, char *buffer, int size, int pos)
break;
case COMPLETION_COMMAND_ARG:
if (completion->completion_list)
- completion_command_arg (completion, 0);
+ completion_command_arg (completion, completion->arg_is_nick);
else
completion_nick (completion);
break;
diff --git a/src/common/completion.h b/src/common/completion.h
index 32850dc2a..2ab419f7b 100644
--- a/src/common/completion.h
+++ b/src/common/completion.h
@@ -38,6 +38,7 @@ struct t_completion
int context; /* context: null, nick, command, cmd arg */
char *base_command; /* command with arg to complete (can be NULL) */
int base_command_arg; /* # arg to complete (if context is cmd arg) */
+ int arg_is_nick; /* argument is nick */
char *base_word; /* word to complete (when Tab was pressed) */
int base_word_pos; /* beggining of base word */
int position; /* position where Tab was pressed */
diff --git a/weechat/src/common/completion.c b/weechat/src/common/completion.c
index a09cfd51b..55c4932d4 100644
--- a/weechat/src/common/completion.c
+++ b/weechat/src/common/completion.c
@@ -52,6 +52,7 @@ completion_init (t_completion *completion, void *server, void *channel)
completion->context = COMPLETION_NULL;
completion->base_command = NULL;
completion->base_command_arg = 0;
+ completion->arg_is_nick = 0;
completion->position = -1;
completion->base_word = NULL;
completion->args = NULL;
@@ -351,6 +352,7 @@ completion_list_add_channel_nicks (t_completion *completion)
&completion->last_completion,
((t_irc_channel *)(completion->channel))->name);
}
+ completion->arg_is_nick = 1;
}
}
@@ -1135,7 +1137,7 @@ completion_search (t_completion *completion, char *buffer, int size, int pos)
break;
case COMPLETION_COMMAND_ARG:
if (completion->completion_list)
- completion_command_arg (completion, 0);
+ completion_command_arg (completion, completion->arg_is_nick);
else
completion_nick (completion);
break;
diff --git a/weechat/src/common/completion.h b/weechat/src/common/completion.h
index 32850dc2a..2ab419f7b 100644
--- a/weechat/src/common/completion.h
+++ b/weechat/src/common/completion.h
@@ -38,6 +38,7 @@ struct t_completion
int context; /* context: null, nick, command, cmd arg */
char *base_command; /* command with arg to complete (can be NULL) */
int base_command_arg; /* # arg to complete (if context is cmd arg) */
+ int arg_is_nick; /* argument is nick */
char *base_word; /* word to complete (when Tab was pressed) */
int base_word_pos; /* beggining of base word */
int position; /* position where Tab was pressed */