summaryrefslogtreecommitdiff
path: root/FL/Fl_Input_.H
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-02-10 17:13:20 +0100
committerGitHub <noreply@github.com>2023-02-10 17:13:20 +0100
commit7f87c847ba8ec976c6ad345942f9867658a89ab2 (patch)
tree00717f3197ea9d2d76c45207dd4f468b2ee201cb /FL/Fl_Input_.H
parent72f860438170638d6aa492b477a59ff88b565d9d (diff)
Unlimited undo/redo for Fl_Input_ and Fl_Text_Buffer (#558) (#676)
Diffstat (limited to 'FL/Fl_Input_.H')
-rw-r--r--FL/Fl_Input_.H9
1 files changed, 9 insertions, 0 deletions
diff --git a/FL/Fl_Input_.H b/FL/Fl_Input_.H
index d89a341bc..a7062f5a0 100644
--- a/FL/Fl_Input_.H
+++ b/FL/Fl_Input_.H
@@ -39,6 +39,7 @@
#define FL_MULTILINE_OUTPUT_WRAP (FL_MULTILINE_INPUT | FL_INPUT_READONLY | FL_INPUT_WRAP)
class Fl_Input_Undo_Action;
+class Fl_Input_Undo_Action_List;
/**
This class provides a low-overhead text input field.
@@ -148,6 +149,8 @@ class FL_EXPORT Fl_Input_ : public Fl_Widget {
/** \internal local undo event */
Fl_Input_Undo_Action* undo_;
+ Fl_Input_Undo_Action_List* undo_list_;
+ Fl_Input_Undo_Action_List* redo_list_;
/** \internal Horizontal cursor position in pixels while moving up or down. */
static double up_down_pos;
@@ -212,6 +215,9 @@ protected:
/* Return the number of lines displayed on a single page. */
int linesPerPage();
+ /* Apply the current undo/redo operation, called from undo() or redo() */
+ int apply_undo();
+
public:
/* Change the size of the widget. */
@@ -378,6 +384,9 @@ public:
/* Undo previous changes to the text buffer. */
int undo();
+ /* Redo previous undo operations. */
+ int redo();
+
/* Copy the yank buffer to the clipboard. */
int copy_cuts();