linebender / piet

An abstraction for 2D graphics.
Apache License 2.0
1.26k stars 94 forks source link

Incorrect expectations for trailing whitespace #411

Open cmyr opened 3 years ago

cmyr commented 3 years ago

expanding on https://github.com/linebender/piet/issues/409#issuecomment-791806965:

I have been misunderstanding the intention of the "trailing whitespace" metric. This should not be about counting any and all whitespace at the end of a line, but rather the range of trailing whitespace that is not relevant for layout. A good heuristic for this is "whitespace the absence of which would not change the drawing of a selection that spans multiple lines".

For our purposes, this should also always include the trailing newline.

I think it's probably worth getting this in for the next piet release, which should be quite imminent.