summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/GTextEditor.h
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibGUI/GTextEditor.h')
-rw-r--r--Libraries/LibGUI/GTextEditor.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/Libraries/LibGUI/GTextEditor.h b/Libraries/LibGUI/GTextEditor.h
index a5be13a415..2b5f658eb0 100644
--- a/Libraries/LibGUI/GTextEditor.h
+++ b/Libraries/LibGUI/GTextEditor.h
@@ -152,8 +152,6 @@ private:
const GTextDocumentLine& line(int index) const { return document().line(index); }
GTextDocumentLine& current_line() { return line(m_cursor.line()); }
const GTextDocumentLine& current_line() const { return line(m_cursor.line()); }
- void insert_at_cursor(char);
- void insert_at_cursor(const StringView&);
int ruler_width() const;
Rect ruler_content_rect(int line) const;
void toggle_selection_if_needed_for_event(const GKeyEvent&);
@@ -174,6 +172,14 @@ private:
int visual_line_containing(int line_index, int column) const;
void recompute_visual_lines(int line_index);
+ template<class T, class... Args>
+ inline void execute(Args&&... args)
+ {
+ auto command = make<T>(*m_document, forward<Args>(args)...);
+ command->redo();
+ m_document->add_to_undo_stack(move(command));
+ }
+
Type m_type { MultiLine };
GTextPosition m_cursor;