MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / DeleteRange

Method DeleteRange

scintilla/src/SplitVector.h:219–233  ·  view source on GitHub ↗

Delete a range from the buffer. Deleting positions outside the current range fails.

Source from the content-addressed store, hash-verified

217 /// Delete a range from the buffer.
218 /// Deleting positions outside the current range fails.
219 void DeleteRange(int position, int deleteLength) {
220 PLATFORM_ASSERT((position >= 0) && (position + deleteLength <= lengthBody));
221 if ((position < 0) || ((position + deleteLength) > lengthBody)) {
222 return;
223 }
224 if ((position == 0) && (deleteLength == lengthBody)) {
225 // Full deallocation returns storage and is faster
226 delete []body;
227 Init();
228 } else if (deleteLength > 0) {
229 GapTo(position);
230 lengthBody -= deleteLength;
231 gapLength += deleteLength;
232 }
233 }
234
235 /// Delete all the buffer contents.
236 void DeleteAll() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected