mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 10:43:47 +08:00
complete_add to take const wcstring& instead of const wchar_t *
An oversight that this wasn't done earlier. No functional change here.
This commit is contained in:
parent
738a6df77d
commit
46678f2eac
|
@ -30,7 +30,7 @@
|
|||
// complete_add function only accepts one short switch and one long switch.
|
||||
|
||||
/// Silly function.
|
||||
static void builtin_complete_add2(const wchar_t *cmd, bool cmd_is_path, const wchar_t *short_opt,
|
||||
static void builtin_complete_add2(const wcstring &cmd, bool cmd_is_path, const wchar_t *short_opt,
|
||||
const wcstring_list_t &gnu_opts, const wcstring_list_t &old_opts,
|
||||
completion_mode_t result_mode, const wcstring_list_t &condition,
|
||||
const wchar_t *comp, const wchar_t *desc,
|
||||
|
@ -63,13 +63,13 @@ static void builtin_complete_add(const wcstring_list_t &cmds, const wcstring_lis
|
|||
const wcstring_list_t &condition, const wchar_t *comp,
|
||||
const wchar_t *desc, complete_flags_t flags) {
|
||||
for (const wcstring &cmd : cmds) {
|
||||
builtin_complete_add2(cmd.c_str(), false /* not path */, short_opt, gnu_opt, old_opt,
|
||||
result_mode, condition, comp, desc, flags);
|
||||
builtin_complete_add2(cmd, false /* not path */, short_opt, gnu_opt, old_opt, result_mode,
|
||||
condition, comp, desc, flags);
|
||||
}
|
||||
|
||||
for (const wcstring &path : paths) {
|
||||
builtin_complete_add2(path.c_str(), true /* is path */, short_opt, gnu_opt, old_opt,
|
||||
result_mode, condition, comp, desc, flags);
|
||||
builtin_complete_add2(path, true /* is path */, short_opt, gnu_opt, old_opt, result_mode,
|
||||
condition, comp, desc, flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1731,11 +1731,10 @@ void append_completion(completion_list_t *completions, wcstring comp, wcstring d
|
|||
completions->emplace_back(std::move(comp), std::move(desc), match, flags);
|
||||
}
|
||||
|
||||
void complete_add(const wchar_t *cmd, bool cmd_is_path, const wcstring &option,
|
||||
void complete_add(const wcstring &cmd, bool cmd_is_path, const wcstring &option,
|
||||
complete_option_type_t option_type, completion_mode_t result_mode,
|
||||
wcstring_list_t condition, const wchar_t *comp, const wchar_t *desc,
|
||||
complete_flags_t flags) {
|
||||
assert(cmd && "Null command");
|
||||
// option should be empty iff the option type is arguments only.
|
||||
assert(option.empty() == (option_type == option_type_args_only));
|
||||
|
||||
|
|
|
@ -224,7 +224,7 @@ void completions_sort_and_prioritize(completion_list_t *comps,
|
|||
/// \param condition a command to be run to check it this completion should be used. If \c condition
|
||||
/// is empty, the completion is always used.
|
||||
/// \param flags A set of completion flags
|
||||
void complete_add(const wchar_t *cmd, bool cmd_is_path, const wcstring &option,
|
||||
void complete_add(const wcstring &cmd, bool cmd_is_path, const wcstring &option,
|
||||
complete_option_type_t option_type, completion_mode_t result_mode,
|
||||
wcstring_list_t condition, const wchar_t *comp, const wchar_t *desc,
|
||||
complete_flags_t flags);
|
||||
|
|
Loading…
Reference in New Issue
Block a user