Open krlmlr opened 7 years ago
Wide in bytes or wide in display characters? @gaborcsardi and I have been having a back and forth over this one.
For tibble it's wide in display characters.
I guess this is easy, because it is kind of independent of the color.
nchar(type = "width")
col_substr
to get that many, colored correctly.But anyway, we indeed should have this in ansistrings
, and/or temporarily in crayon
.
We may want to do nchar(strsplit(x, "")[[1]][seq_len(n)], type = "width")
and then employ cumsum()
.
Would work, but risks being slow. I guess in the likely application you're thinking of (truncate long char cells in tibble, where only n rows are shown), it's probably tolerable. And you're definitely thinking of truncation, not wrapping, right?
Yes, wrapping is yet another issue.
that is aware of wide characters.