1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-26 16:09:27 -05:00

fix(cli/tools/repl): dont highlight candidate when completion is list (#11697)

This commit is contained in:
Casper Beyer 2021-08-14 16:19:30 +08:00 committed by GitHub
parent ed19e32d98
commit b8cfc95470
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -290,10 +290,14 @@ impl Highlighter for EditorHelper {
fn highlight_candidate<'c>( fn highlight_candidate<'c>(
&self, &self,
candidate: &'c str, candidate: &'c str,
_completion: rustyline::CompletionType, completion: rustyline::CompletionType,
) -> Cow<'c, str> { ) -> Cow<'c, str> {
if completion == CompletionType::List {
candidate.into()
} else {
self.highlight(candidate, 0) self.highlight(candidate, 0)
} }
}
fn highlight_char(&self, line: &str, _: usize) -> bool { fn highlight_char(&self, line: &str, _: usize) -> bool {
!line.is_empty() !line.is_empty()