mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
GTextEditor: Add a way to flush any pending on_change notifications
Since on_change handlers can alter the text document we're working on, we have to make sure they've been run before we try looking at spans. This fixes some flakiness when a paint happened before HackStudio had a chance to re-highlight some C++ while editing it. The design where clients of GTextEditor perform syntax highlighting in the "arbitrary code execution" on_change callback is not very good. We should find a way to move highlighting closer to the editor.
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 11:19:36 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c16b1a515e9
@@ -160,6 +160,7 @@ private:
|
||||
Rect visible_text_rect_in_inner_coordinates() const;
|
||||
void recompute_all_visual_lines();
|
||||
void ensure_cursor_is_valid();
|
||||
void flush_pending_change_notification_if_needed();
|
||||
|
||||
class UndoCommand {
|
||||
|
||||
@@ -233,7 +234,7 @@ private:
|
||||
bool m_cursor_state { true };
|
||||
bool m_in_drag_select { false };
|
||||
bool m_ruler_visible { false };
|
||||
bool m_have_pending_change_notification { false };
|
||||
bool m_has_pending_change_notification { false };
|
||||
bool m_automatic_indentation_enabled { false };
|
||||
bool m_line_wrapping_enabled { false };
|
||||
bool m_readonly { false };
|
||||
|
||||
Reference in New Issue
Block a user