-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hardcoded continuation prompt implementation with continuation_prompt
feature
#3
base: highlight
Are you sure you want to change the base?
Conversation
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_prompt
feature.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
Helper
inEditor
should behelper: H
, rather thanhelper: Option<H>
, then we can avoid lifetime issue when using&mut self
inhighlight
,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