| 88 | } |
| 89 | } |
| 90 | void InsertSpace(Sci::Position position, Sci::Position insertLength) { |
| 91 | assert(position <= Length()); // Only operation that works at end. |
| 92 | const Sci::Position partition = starts->PartitionFromPosition(position); |
| 93 | const Sci::Position startPartition = starts->PositionFromPartition(partition); |
| 94 | if (startPartition == position) { |
| 95 | const bool positionOccupied = values->ValueAt(partition) != T(); |
| 96 | // Inserting at start of run so make previous longer |
| 97 | if (partition == 0) { |
| 98 | // Inserting at start of document so ensure start empty |
| 99 | if (positionOccupied) { |
| 100 | starts->InsertPartition(1, 0); |
| 101 | values->InsertEmpty(0, 1); |
| 102 | } |
| 103 | starts->InsertText(partition, insertLength); |
| 104 | } else { |
| 105 | if (positionOccupied) { |
| 106 | starts->InsertText(partition - 1, insertLength); |
| 107 | } else { |
| 108 | // Insert at end of run so do not extend style |
| 109 | starts->InsertText(partition, insertLength); |
| 110 | } |
| 111 | } |
| 112 | } else { |
| 113 | starts->InsertText(partition, insertLength); |
| 114 | } |
| 115 | } |
| 116 | void DeletePosition(Sci::Position position) { |
| 117 | assert(position < Length()); |
| 118 | Sci::Position partition = starts->PartitionFromPosition(position); |
nothing calls this directly
no test coverage detected