mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibGUI: Fix cursor being out of view after typing
Previously, if the cursor moved out of the visible area while text was being inserted, the text editor would never scroll the cursor back into view until the arrow keys were pressed to move the cursor. This was caused by the TextEditor's reflow deferral system stopping visual line recomputation until the end of text insertion, so now when reflow deferral is completed, the TextEditor will make sure the cursor is visible.
This commit is contained in:
parent
4d4e578edf
commit
061938206a
Notes:
sideshowbarker
2024-07-19 05:59:11 +09:00
Author: https://github.com/FalseHonesty Commit: https://github.com/SerenityOS/serenity/commit/061938206a5 Pull-request: https://github.com/SerenityOS/serenity/pull/2446
1 changed files with 3 additions and 1 deletions
|
@ -1244,8 +1244,10 @@ void TextEditor::undefer_reflow()
|
||||||
{
|
{
|
||||||
ASSERT(m_reflow_deferred);
|
ASSERT(m_reflow_deferred);
|
||||||
if (!--m_reflow_deferred) {
|
if (!--m_reflow_deferred) {
|
||||||
if (m_reflow_requested)
|
if (m_reflow_requested) {
|
||||||
recompute_all_visual_lines();
|
recompute_all_visual_lines();
|
||||||
|
scroll_cursor_into_view();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue