mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:57:44 +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
|
@ -161,7 +161,7 @@ public:
|
|||
void register_key_input_callback(Key key, Function<bool(Editor&)> callback) { register_key_input_callback(Vector<Key> { key }, move(callback)); }
|
||||
|
||||
static StringMetrics actual_rendered_string_metrics(StringView, RedBlackTree<u32, Optional<Style::Mask>> const& masks = {}, Optional<size_t> maximum_line_width = {});
|
||||
static StringMetrics actual_rendered_string_metrics(Utf32View const&, RedBlackTree<u32, Optional<Style::Mask>> const& masks = {});
|
||||
static StringMetrics actual_rendered_string_metrics(Utf32View const&, RedBlackTree<u32, Optional<Style::Mask>> const& masks = {}, Optional<size_t> maximum_line_width = {});
|
||||
|
||||
Function<Vector<CompletionSuggestion>(Editor const&)> on_tab_complete;
|
||||
Function<void(Utf32View, Editor&)> on_paste;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue