Closed ghost closed 9 years ago
This looks great! I definitely share your sentiments regarding the heaviness of the API, when I was writing this I wasn't happy with it either but didn't have many ideas on how to implement it in a more lightweight fashion.
I've also been thinking of taking out a lot of the with_xxx()
methods, and replacing them with easily chained methods. This is a great help on the road to completing that, thanks again!
This looks good to me, and the tests have passed, so lets get this merged!
Remove
Style
in order to flattenCell
structure. Rather thanfg
andbg
each having both aColor
and aAttr
, they both become straight upColor
and we add a newattrs
attribute to theCell
.This is more in line with the underlying driver (the
term
module) which doesn't apply its attribute to foreground or background. It's always the whole cell that it affected.It also makes working with the API a bit lighter. It could become cumbersome to have to involve both
Style
andColor
in order to change foreground or background colors.@cpjreynolds what do you think about this change? I wanted to try it out (hence this PR) because the more I work with rustty, the more I find the
Style
API needlessly heavy. So the other day, I dig in the code and see thatAttr
isn't really tied to either fg or bg in the underlying driver, so I think "why give us this trouble"? So here's a PR giving an idea of what it looks like withoutStyle
.