1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:07:35 +00:00

LibLine: Use grapheme clusters for cursor management

This makes using the line editor much nicer when multi-code-point
graphemes are present in the input (e.g. flag emojis, or some cjk
glyphs), and avoids messing up the buffer when deleting text, or
cursoring around.
This commit is contained in:
Ali Mohammad Pur 2023-12-15 15:01:58 +03:30 committed by Andreas Kling
parent 99cc0514a7
commit 36f0499cc8
5 changed files with 58 additions and 48 deletions

View file

@ -27,6 +27,7 @@ struct StringMetrics {
};
Vector<LineMetrics> line_metrics;
Vector<size_t> grapheme_breaks {};
size_t total_length { 0 };
size_t max_line_length { 0 };