mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibGUI: Use set_cursor() in TextEditor::set_document()
Instead of setting m_cursor directly to reset the cursor position, TextEditor::set_document() now uses set_cursor() which will call cursor change callback functions, if any. This fixes a bug in HackStudio where the cursor information text would not update immediately after changing the active TextDocument, even though the cursor is always visibly being reset to 0, 0.
This commit is contained in:
parent
e2b4fef6c7
commit
9ef834384d
Notes:
sideshowbarker
2024-07-19 04:16:18 +09:00
Author: https://github.com/linusg
Commit: 9ef834384d
Pull-request: https://github.com/SerenityOS/serenity/pull/3015
1 changed files with 1 additions and 1 deletions
|
@ -1659,7 +1659,7 @@ void TextEditor::set_document(TextDocument& document)
|
|||
for (size_t i = 0; i < m_document->line_count(); ++i) {
|
||||
m_line_visual_data.append(make<LineVisualData>());
|
||||
}
|
||||
m_cursor = { 0, 0 };
|
||||
set_cursor(0, 0);
|
||||
if (has_selection())
|
||||
m_selection.clear();
|
||||
recompute_all_visual_lines();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue