Commit d2a975ec authored by Sag0Sag0's avatar Sag0Sag0

Fix problem where the highlighting closure wasn’t used whilst giving autocomplete suggestion

parent 4441c4dc
......@@ -731,7 +731,11 @@ impl<'a, W: Write> Editor<'a, W> {
if buf_num_remaining_bytes == 0 {
write!(self.out, "{}", line)?;
} else if line.len() > buf_num_remaining_bytes {
write!(self.out, "{}", &line[..buf_num_remaining_bytes])?;
let start = &line[..buf_num_remaining_bytes];
match self.closure {
Some(ref f) => write!(self.out, "{}", f(start))?,
None => write!(self.out, "{}", start)?,
}
write!(self.out, "{}", color::Fg(color::Yellow))?;
write!(self.out, "{}", &line[buf_num_remaining_bytes..])?;
buf_num_remaining_bytes = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment