feat: addressed review comments
This commit is contained in:
@@ -81,7 +81,8 @@ impl Completer for ReplCompleter {
|
|||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|(name, description)| (format!(".{name}"), description))
|
.map(|(name, description)| (format!(".{name}"), description))
|
||||||
.filter(|(name, _)| {
|
.filter(|(name, _)| {
|
||||||
command_filter.len() == 1 || name.starts_with(&command_filter[..2])
|
command_filter.len() == 1
|
||||||
|
|| name.starts_with(command_filter.get(..2).unwrap_or(&command_filter))
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
let macros = fuzzy_filter(macros, |(name, _)| name.as_str(), &command_filter);
|
let macros = fuzzy_filter(macros, |(name, _)| name.as_str(), &command_filter);
|
||||||
|
|||||||
+1
-1
@@ -1086,7 +1086,7 @@ pub async fn run_repl_command(
|
|||||||
macro_execute(ctx, name, extra, abort_signal.clone()).await?;
|
macro_execute(ctx, name, extra, abort_signal.clone()).await?;
|
||||||
}
|
}
|
||||||
Some(MacroState::DisabledRuntime) => bail!(
|
Some(MacroState::DisabledRuntime) => bail!(
|
||||||
r#"Macro '{name}' is disabled. Enable it with ".macro enable {name}""#
|
r#"Macro '{name}' is disabled. Re-enable it with ".macro enable {name}""#
|
||||||
),
|
),
|
||||||
Some(MacroState::Locked { level }) => bail!(
|
Some(MacroState::Locked { level }) => bail!(
|
||||||
"Macro '{name}' is restricted by {} enabled_macros",
|
"Macro '{name}' is restricted by {} enabled_macros",
|
||||||
|
|||||||
Reference in New Issue
Block a user