MCPcopy Create free account
hub / github.com/cxasm/notepad-- / DeletePosition

Method DeletePosition

src/qscint/scintilla/src/SparseVector.h:116–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114 }
115 }
116 void DeletePosition(Sci::Position position) {
117 assert(position < Length());
118 Sci::Position partition = starts->PartitionFromPosition(position);
119 const Sci::Position startPartition = starts->PositionFromPartition(partition);
120 if (startPartition == position) {
121 if (partition == 0) {
122 ClearValue(0);
123 } else if (partition == starts->Partitions()) {
124 // This should not be possible
125 ClearValue(partition);
126 throw std::runtime_error("SparseVector: deleting end partition.");
127 } else {
128 ClearValue(partition);
129 starts->RemovePartition(partition);
130 values->Delete(partition);
131 // Its the previous partition now that gets smaller
132 partition--;
133 }
134 }
135 starts->InsertText(partition, -1);
136 }
137 void Check() const {
138 if (Length() < 0) {
139 throw std::runtime_error("SparseVector: Length can not be negative.");

Callers 1

DeleteLineMethod · 0.80

Calls 6

PartitionFromPositionMethod · 0.80
PositionFromPartitionMethod · 0.80
PartitionsMethod · 0.80
RemovePartitionMethod · 0.80
DeleteMethod · 0.45
InsertTextMethod · 0.45

Tested by

no test coverage detected