| 114 | } |
| 115 | |
| 116 | void InsertText(int partitionInsert, int delta) { |
| 117 | // Point all the partitions after the insertion point further along in the buffer |
| 118 | if (stepLength != 0) { |
| 119 | if (partitionInsert >= stepPartition) { |
| 120 | // Fill in up to the new insertion point |
| 121 | ApplyStep(partitionInsert); |
| 122 | stepLength += delta; |
| 123 | } else if (partitionInsert >= (stepPartition - body->Length() / 10)) { |
| 124 | // Close to step but before so move step back |
| 125 | BackStep(partitionInsert); |
| 126 | stepLength += delta; |
| 127 | } else { |
| 128 | ApplyStep(body->Length()-1); |
| 129 | stepPartition = partitionInsert; |
| 130 | stepLength = delta; |
| 131 | } |
| 132 | } else { |
| 133 | stepPartition = partitionInsert; |
| 134 | stepLength = delta; |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | void RemovePartition(int partition) { |
| 139 | if (partition > stepPartition) { |