If a terminal emulator supports the kitty protocol, this change will
allow cove to take advantage of this. This means that more modifiers
will work on special keys like enter or escape.
See also this section of the kitty protocol docs:
https://sw.kovidgoyal.net/kitty/keyboard-protocol/#disambiguate-escape-codes
If there were multiple forced breaks in succession, all except the first
would be a bit too wide since I forgot to include the current grapheme
in the new line's width.
The previous implementation of Styled used chunks that consisted of a
String and a ContentStyle. The current implementation instead stores a
single String and chunks consisting of a ContentStyle and an ending
index.
This implementation may reduce allocations and makes width-related
operations easier, for example getting the width of a Styled with its
whitespace trimmed.
This lets the user restrict the drawable area to a sub-area of the
buffer. This lets the user draw without caring about the absolute
position, and guarantees that no glyphs or glyph parts appear outside of
the drawable area.
Previously, when overwriting wide graphemes, those were not first
cleared from the buffer. This could sometimes result in partial
graphemes, which is an invalid buffer state.
Now, when a wide grapheme is overwritten, it is removed from the buffer
entirely and replaced with spaces. Those spaces retain the style of the
removed grapheme.
A similar thing now happens with graphemes that only partially overlap
the buffer, either on the left or the right border. Those parts that are
inside the buffer are rendered as spaces with the grapheme's style.