summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorSimonFJ20 <simonfromjakobsen@gmail.com>2022-04-13 16:14:59 +0200
committerAndreas Kling <kling@serenityos.org>2022-04-13 21:24:48 +0200
commit791e881892c7fa55b4f4ed5b885ac3f156276ca2 (patch)
tree1ecc9c954d365d1485c8e4f841897e5e01cfdc98 /Userland/Libraries
parent50ca1b3d873c3a23312246fead0d30eb0f5af8c2 (diff)
downloadserenity-791e881892c7fa55b4f4ed5b885ac3f156276ca2.zip
LibGUI: Rename function to make intention clearer
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibGUI/TextEditor.cpp4
-rw-r--r--Userland/Libraries/LibGUI/TextEditor.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibGUI/TextEditor.cpp b/Userland/Libraries/LibGUI/TextEditor.cpp
index 0ea96cc616..93cf86c055 100644
--- a/Userland/Libraries/LibGUI/TextEditor.cpp
+++ b/Userland/Libraries/LibGUI/TextEditor.cpp
@@ -1446,14 +1446,14 @@ void TextEditor::insert_at_cursor_or_replace_selection(StringView text)
}
}
-void TextEditor::replace_all_text_while_keeping_undo_stack(StringView text)
+void TextEditor::replace_all_text_without_resetting_undo_stack(StringView text)
{
auto start = GUI::TextPosition(0, 0);
auto last_line_index = line_count() - 1;
auto end = GUI::TextPosition(last_line_index, line(last_line_index).length());
auto range = GUI::TextRange(start, end);
auto normalized_range = range.normalized();
- execute<ReplaceAllTextCommand>(text, range);
+ execute<ReplaceAllTextCommand>(text, range, "GML Playground Format Text");
did_change();
set_cursor(normalized_range.start());
update();
diff --git a/Userland/Libraries/LibGUI/TextEditor.h b/Userland/Libraries/LibGUI/TextEditor.h
index cb4d2f58ff..1bd5b1401a 100644
--- a/Userland/Libraries/LibGUI/TextEditor.h
+++ b/Userland/Libraries/LibGUI/TextEditor.h
@@ -123,7 +123,7 @@ public:
TextRange normalized_selection() const { return m_selection.normalized(); }
void insert_at_cursor_or_replace_selection(StringView);
- void replace_all_text_while_keeping_undo_stack(StringView text);
+ void replace_all_text_without_resetting_undo_stack(StringView text);
bool write_to_file(String const& path);
bool write_to_file(Core::File&);
bool has_selection() const { return m_selection.is_valid(); }