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

Method MoveForInsertDelete

scintilla/src/Selection.cxx:23–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21#endif
22
23void SelectionPosition::MoveForInsertDelete(bool insertion, int startChange, int length) {
24 if (insertion) {
25 if (position == startChange) {
26 int virtualLengthRemove = std::min(length, virtualSpace);
27 virtualSpace -= virtualLengthRemove;
28 position += virtualLengthRemove;
29 } else if (position > startChange) {
30 position += length;
31 }
32 } else {
33 if (position == startChange) {
34 virtualSpace = 0;
35 }
36 if (position > startChange) {
37 int endDeletion = startChange + length;
38 if (position > endDeletion) {
39 position -= length;
40 } else {
41 position = startChange;
42 virtualSpace = 0;
43 }
44 }
45 }
46}
47
48bool SelectionPosition::operator <(const SelectionPosition &other) const {
49 if (position == other.position)

Callers 1

MovePositionsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected