1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-29 17:15:11 +00:00

LibGUI: Make TextEditor::select_all() move the cursor to document head

This feels a lot nicer than moving the cursor to the document end.
This commit is contained in:
Andreas Kling 2020-05-27 18:41:54 +02:00
parent 99e775cee3
commit 30edd198ec

View file

@ -535,9 +535,9 @@ void TextEditor::select_all()
{ {
TextPosition start_of_document { 0, 0 }; TextPosition start_of_document { 0, 0 };
TextPosition end_of_document { line_count() - 1, line(line_count() - 1).length() }; TextPosition end_of_document { line_count() - 1, line(line_count() - 1).length() };
m_selection.set(start_of_document, end_of_document); m_selection.set(end_of_document, start_of_document);
did_update_selection(); did_update_selection();
set_cursor(end_of_document); set_cursor(start_of_document);
update(); update();
} }