aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CellBuffer.cxx29
-rw-r--r--src/Editor.cxx2
2 files changed, 14 insertions, 17 deletions
diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx
index 10e0a1859..8bdb3d104 100644
--- a/src/CellBuffer.cxx
+++ b/src/CellBuffer.cxx
@@ -418,22 +418,19 @@ UndoHistory::~UndoHistory() {
}
void UndoHistory::EnsureUndoRoom() {
- //Platform::DebugPrintf("%% %d action %d %d %d\n", at, position, length, currentAction);
- if (currentAction >= 2) {
- // Have to test that there is room for 2 more actions in the array
- // as two actions may be created by this function
- if (currentAction >= (lenActions - 2)) {
- // Run out of undo nodes so extend the array
- int lenActionsNew = lenActions * 2;
- Action *actionsNew = new Action[lenActionsNew];
- if (!actionsNew)
- return ;
- for (int act = 0; act <= currentAction; act++)
- actionsNew[act].Grab(&actions[act]);
- delete []actions;
- lenActions = lenActionsNew;
- actions = actionsNew;
- }
+ // Have to test that there is room for 2 more actions in the array
+ // as two actions may be created by the calling function
+ if (currentAction >= (lenActions - 2)) {
+ // Run out of undo nodes so extend the array
+ int lenActionsNew = lenActions * 2;
+ Action *actionsNew = new Action[lenActionsNew];
+ if (!actionsNew)
+ return ;
+ for (int act = 0; act <= currentAction; act++)
+ actionsNew[act].Grab(&actions[act]);
+ delete []actions;
+ lenActions = lenActionsNew;
+ actions = actionsNew;
}
}
diff --git a/src/Editor.cxx b/src/Editor.cxx
index f2bac993b..bf53de224 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -30,7 +30,7 @@
#include "Editor.h"
Caret::Caret() :
-active(true), on(true), period(500) {}
+active(false), on(false), period(500) {}
Timer::Timer() :
ticking(false), ticksToWait(0), tickerID(0) {}