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:
parent
99cc0514a7
commit
36f0499cc8
5 changed files with 58 additions and 48 deletions
|
@ -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 };
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue