Closed sigmaSd closed 3 years ago
Actually using an intermediate struct could work, I was thinking that highlight function signature would need to change, but if the struct implemented conversion to Cow , it would work with no changes.
so the user usage would look like:
fn highlight(line, pos) -> Cow {
line.bold().red().blue_bg().into()
}
I guess that's reasonable, thanks for your answer.
I'm going to use this issue to ask another question, what about using github discussions https://docs.github.com/en/discussions/quickstart
I think simple questions comes up frequently (like the ones I opened) and they don't need to clutter the issue tracker, I think discussions would help to mitigate that.
I don't mind if you create issues.
And I cannot change settings: a long time ago (at least one year) kkawakam
asked me to move rustyline
repository to another place. I thought about the Rust CLI WG but did nothing...
Ok that makes sense, thanks again.
The working group looks like a good idea, but the current state is also fine I think.
I think that rustlyine offers a really nice out of the box tui experience, but having to write ansi colors code manually each time feels like it contradicts this philosophy.
Adding a simple color Api would make this way more pleasant for the user.
Here is a simple color Api that exposes only one trait
Color
. This could be extended to support bg simply. Supporting fg on top of bg requires an intermediate struct, which kind of ruins the simplicity.