Removing TextEditor from strings for now
This commit is contained in:
parent
eb9210de1c
commit
d362d8c3b3
7 changed files with 65 additions and 1049 deletions
|
|
@ -170,5 +170,24 @@ namespace tp {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static void calcLineOffsets(const tChar* aBuff, Index aLength, Buffer<Index>& aOut) {
|
||||
halni lines = 0;
|
||||
for (auto idx : Range(aLength)) {
|
||||
if (isNewLineChar(aBuff[idx])) {
|
||||
lines++;
|
||||
}
|
||||
}
|
||||
aOut.reserve(lines + 2); // plus start and end offsets
|
||||
lines = 0;
|
||||
for (auto idx : Range(aLength)) {
|
||||
if (isNewLineChar(aBuff[idx])) {
|
||||
aOut[lines + 1] = Index(idx + 1);
|
||||
lines++;
|
||||
}
|
||||
}
|
||||
aOut[0] = 0;
|
||||
aOut[lines + 1] = aLength;
|
||||
}
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue