Hardcoded continuation prompt implementation with continuation_prompt feature#3
Hardcoded continuation prompt implementation with continuation_prompt feature#3zao111222333 wants to merge 13 commits intogwenn:highlightfrom
continuation_prompt feature#3Conversation
94a5899 to
f53ba9e
Compare
|
The feedback is wanted, and I'd like to change along your suggestion :) |
|
See https://github.com/gwenn/rustyline/pull/2/files#diff-21d5a115156e525615d2209606c575558d8ba3348ad5d75bc36db7f06d3adfea |
|
I see... How about this approach: The The If this approach looks good to you, I can help. |
|
So you reject / don't like the idea of having a layout cache |
|
Another issue is that currently the only repaint optimisation is here:
I am sceptical |
I am looking into your layout cache. Can could you give me a little more information of |
I'm sorry but I am still a little confuse of the meaning of optional Helper / Highlighter. |
If you think of And even if we could remove the setter, why not keep the Helper optional in constructor ? Editor::new<H: Helper>(helper: Option<H>)Also: |
|
Thank you for providing me those information. I known Then I will try to combine #2 and highlight. |
|
If possible, try to send a dedicated PR for mutable helper based on rustyline master branch (without highlight split stuff). |
Hi, I believe this version is well-defined, pls take a while to review:)
Hardcoded continuation prompt implementation with


continuation_promptfeature.See Refactor highlighting kkawakam/rustyline#795
With example at
examples/continuation_prompt.rs:Also, verify with my python REPL project https://github.com/zao111222333/pyapp
Reduce tokenizer/parser overhead
I believe the
HelperinEditorshould behelper: H, rather thanhelper: Option<H>, then we can avoid lifetime issue when using&mut selfinhighlight,validate,complete, ...as you have mentioned at
https://github.com/gwenn/rustyline/blob/highlight/src/completion.rs#L93
That's a quite large breaking change, but with this change, we can reduce the overhead and only tokenizer/parser once! see:
before https://github.com/gwenn/rustyline/blob/highlight/src/lib.rs#L543
now https://github.com/zao111222333/rustyline/blob/highlight/src/lib.rs#L547-L576