summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2021-08-14 16:19:30 +0800
committerGitHub <noreply@github.com>2021-08-14 10:19:30 +0200
commitb8cfc9547023a30df991047e7a32e3e661faecfa (patch)
tree945ed2afa43ea1748d1bfb05fbf04297919fa772
parented19e32d98ce4be126d71ef871b5c7a700f1c895 (diff)
fix(cli/tools/repl): dont highlight candidate when completion is list (#11697)
-rw-r--r--cli/tools/repl.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/cli/tools/repl.rs b/cli/tools/repl.rs
index 3de859698..e313d1735 100644
--- a/cli/tools/repl.rs
+++ b/cli/tools/repl.rs
@@ -290,9 +290,13 @@ impl Highlighter for EditorHelper {
fn highlight_candidate<'c>(
&self,
candidate: &'c str,
- _completion: rustyline::CompletionType,
+ completion: rustyline::CompletionType,
) -> Cow<'c, str> {
- self.highlight(candidate, 0)
+ if completion == CompletionType::List {
+ candidate.into()
+ } else {
+ self.highlight(candidate, 0)
+ }
}
fn highlight_char(&self, line: &str, _: usize) -> bool {