Skip to content

Apache DataFusion SQL Query Engine

fix: Do not highlight the CLI hint directly (#21858)

Nuno Fariad1939624b12c
diff --git a/datafusion-cli/src/helper.rs b/datafusion-cli/src/helper.rs
index f01d0891b9..67e203cf79 100644
--- a/datafusion-cli/src/helper.rs
+++ b/datafusion-cli/src/helper.rs
@@ -124,6 +124,10 @@ impl Highlighter for CliHelper {
fn highlight_char(&self, line: &str, pos: usize, kind: CmdKind) -> bool {
self.highlighter.highlight_char(line, pos, kind)
}
+
+ fn highlight_hint<'h>(&self, hint: &'h str) -> Cow<'h, str> {
+ Color::gray(hint).into()
+ }
}
impl Hinter for CliHelper {
@@ -134,7 +138,7 @@ impl Hinter for CliHelper {
self.show_hint.set(false);
}
(self.show_hint.get() && line.trim().is_empty())
- .then(|| Color::gray(DEFAULT_HINT_SUGGESTION))
+ .then(|| DEFAULT_HINT_SUGGESTION.to_owned())
}
}