mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
use original command when ranking for possible commands if the command was from an optional branch
This commit is contained in:
parent
f72145b3db
commit
dc9b7b3e6b
2 changed files with 7 additions and 4 deletions
|
|
@ -246,8 +246,10 @@ pub fn edit() -> impl Iterator<Item = Command> {
|
||||||
]
|
]
|
||||||
.map(apply_list_opts);
|
.map(apply_list_opts);
|
||||||
|
|
||||||
let system_groups_cmd =
|
let system_groups_cmd = once(
|
||||||
once(command!(system, Optional(SystemRef), "groups", search_param => "system_groups"))
|
command!(system, Optional(SystemRef), "groups", search_param => "system_groups")
|
||||||
|
.help("Lists groups in a system"),
|
||||||
|
)
|
||||||
.map(apply_list_opts);
|
.map(apply_list_opts);
|
||||||
|
|
||||||
let system_display_id_cmd = once(
|
let system_display_id_cmd = once(
|
||||||
|
|
|
||||||
|
|
@ -346,6 +346,7 @@ fn rank_possible_commands(
|
||||||
) -> Vec<(Command, String, bool)> {
|
) -> Vec<(Command, String, bool)> {
|
||||||
let mut commands_with_scores: Vec<(&Command, String, f64, bool)> = possible_commands
|
let mut commands_with_scores: Vec<(&Command, String, f64, bool)> = possible_commands
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
.map(|cmd| cmd.original.as_deref().unwrap_or(cmd))
|
||||||
.filter(|cmd| cmd.show_in_suggestions)
|
.filter(|cmd| cmd.show_in_suggestions)
|
||||||
.flat_map(|cmd| {
|
.flat_map(|cmd| {
|
||||||
let versions = generate_command_versions(cmd);
|
let versions = generate_command_versions(cmd);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue