Conversation
|
Thank you for all your proposals. |
| mut reader: impl BufRead, | ||
| mut writer: impl Write, | ||
| validator: &Option<impl Validator>, | ||
| mut validator: Option<&mut impl Validator>, |
There was a problem hiding this comment.
not sure why you need the mut validator
There was a problem hiding this comment.
The match block requires the input validator is mutable. And when we call it, use readline_direct(io::stdin().lock(), io::stderr(), self.helper.as_mut()), it is almost same as before
Lines 519 to 523 in 77e7d3d
src/edit.rs
Outdated
| self.line.as_str() | ||
| } | ||
| } | ||
| // We only use `self.line` to create `impl Invoke`. |
rustyline-derive/src/lib.rs
Outdated
| impl #impl_generics ::rustyline::highlight::Highlighter for #name #ty_generics #where_clause { | ||
| fn highlight<'l>(&self, line: &'l str, pos: usize) -> ::std::borrow::Cow<'l, str> { | ||
| ::rustyline::highlight::Highlighter::highlight(&self.#field_name_or_index, line, pos) | ||
| #[cfg(any(not(feature = "split-highlight"), feature = "ansi-str"))] |
There was a problem hiding this comment.
No split-highlight in this PR please
There was a problem hiding this comment.
I am sorry for that, I directly copy rustyline-derive/src/lib.rs for the old version. I only copy this single file and I will remove those :)
gwenn
left a comment
There was a problem hiding this comment.
Remove all Parser / split-highlight related code
|
See Line 9 in ceafb7f InputEdit impl (except for Begin / End)
|
Understand, and since the |
|
Here is the update under your suggestions. I haven't fixed |
Parser trait & mutable Helper in functionsHelper in functions
|
You need the Lines 102 to 105 in ceafb7f |
|
Or at least use a part of Lines 250 to 253 in 8fc0037 Now I am not sure which |
See gwenn#4

And I add a new
example/bracket_parser.rsto demoParsertrait.btw, rightnow I have no idea how to represent
change: InputEdit.