Cleanup and bump rustyline

This commit is contained in:
Jonathan Turner
2019-06-10 05:52:56 +12:00
parent dfd2a6b1a9
commit 62fac11e07
7 changed files with 27 additions and 40 deletions

View File

@@ -19,7 +19,6 @@ impl Completer for NuCompleter {
pos: usize,
context: &rustyline::Context,
) -> rustyline::Result<(usize, Vec<completion::Pair>)> {
let commands: Vec<String> = self.commands.keys().cloned().collect();
let mut completions = self.file_completer.complete(line, pos, context)?.1;
@@ -51,8 +50,8 @@ impl Completer for NuCompleter {
if matched {
completions.push(completion::Pair {
display: command.to_string(),
replacement: command.to_string(),
display: command.clone(),
replacement: command.clone(),
});
}
}

View File

@@ -47,7 +47,7 @@ impl Hinter for Helper {
}
impl Highlighter for Helper {
fn highlight_prompt<'p>(&self, prompt: &'p str) -> Cow<'p, str> {
fn highlight_prompt<'b, 's: 'b, 'p:'b>(&'s self, prompt: &'p str, _: bool) -> Cow<'b, str> {
Owned("\x1b[32m".to_owned() + &prompt[0..prompt.len() - 2] + "\x1b[m> ")
}