Closed zao111222333 closed 2 weeks ago
See https://github.com/kkawakam/rustyline/pull/795
Use ansi-str-fork to introduce
fn get_blocks<'a>(text: Cow<'a, str>) -> AnsiBlockIter<'a>
(see more at ansitok-fork)
Fix highlight_line function signature into:
highlight_line
fn highlight_line<'l>(&self, line: &'l str, pos: usize) -> impl Iterator<Item = impl 'l+StyledBlock>
The new highlight_line function signature conflicts to the Option<&dyn Highligher> due to https://doc.rust-lang.org/reference/items/traits.html#object-safety . So use generic <H: Highligher> + Option<&H> to replace Option<&dyn Highligher>
Option<&dyn Highligher>
<H: Highligher>
Option<&H>
See https://github.com/kkawakam/rustyline/pull/795
Use ansi-str-fork to introduce
(see more at ansitok-fork)
Fix
highlight_line
function signature into:The new
highlight_line
function signature conflicts to theOption<&dyn Highligher>
due to https://doc.rust-lang.org/reference/items/traits.html#object-safety . So use generic<H: Highligher>
+Option<&H>
to replaceOption<&dyn Highligher>