From 51a4bdfd9d7da90402bc341c0bc59a9ae6f7928f Mon Sep 17 00:00:00 2001 From: Jerome St-Louis Date: Sat, 22 Oct 2016 10:05:59 -0400 Subject: [PATCH] ecere/gui/EditBox: Clearing Undo buffer on setting contents - Added Clear() method to UndoBuffer --- ecere/src/gui/controls/EditBox.ec | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ecere/src/gui/controls/EditBox.ec b/ecere/src/gui/controls/EditBox.ec index a811a1b..05816d5 100644 --- a/ecere/src/gui/controls/EditBox.ec +++ b/ecere/src/gui/controls/EditBox.ec @@ -298,6 +298,15 @@ public: else delete action; } + + void Clear() + { + actions.Free(); + actions.size = 8; + count = 0; + curAction = 0; + firstEvent = true; + } }; static class AddCharAction : UndoAction @@ -816,6 +825,8 @@ public: { if(this) { + undoBuffer.Clear(); + undoBuffer.dontRecord++; Deselect(); DelCh(this.lines.first, 0, 0, this.lines.last, this.lineCount-1, ((EditLine)(this.lines.last)).count, true); -- 1.8.3.1