ratatui / ansi-to-tui

Convert ansi colored text to tui::text::Text
https://crates.io/crates/ansi-to-tui
MIT License
57 stars 21 forks source link

Is it a naive implementation? #8

Closed grtcdr closed 3 years ago

grtcdr commented 3 years ago

It seems to me like ansi-to-tui is very stable for the two dependents on your crate, so you might as well get rid of the last sentence in the README. It could deter some people and I for one think more people should be using this :)

uttarayan21 commented 3 years ago

You are right. However I do think it's a naive implementation. Since I'm reading bytes one by one and parsing them. There could be a better way to process this. I'll remove it for now.

grtcdr commented 3 years ago

However I do think it's a naive implementation. Since I'm reading bytes one by one and parsing them. There could be a better way to process this.

What other ways are more efficient? I would say caching could improve it, but it's not a slow library whatsoever.

uttarayan21 commented 3 years ago

That's true it's not slow, and I don't have a way to improve it. But since it is a basic approach there maybe ways to improve it which I don't know of. Also caching could work but it's too much of a hassle to add right now.

grtcdr commented 3 years ago

Yeah cache AFAIK is quite hard to implement properly, and it's really not needed anyways since the program is still super fast (at least for ASCII art which usually isn't that big).