feat: addressed review comments

This commit is contained in:
2026-08-21 11:55:14 -06:00
parent 95dd31e24b
commit 03687c8981
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -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
View File
@@ -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",