use of com.intellij.openapi.util.text.LineTokenizer in project intellij-community by JetBrains.
the class LineSet method createLineSet.
@NotNull
private static LineSet createLineSet(@NotNull CharSequence text, boolean markModified) {
TIntArrayList starts = new TIntArrayList();
TByteArrayList flags = new TByteArrayList();
LineTokenizer lineTokenizer = new LineTokenizer(text);
while (!lineTokenizer.atEnd()) {
starts.add(lineTokenizer.getOffset());
flags.add((byte) (lineTokenizer.getLineSeparatorLength() | (markModified ? MODIFIED_MASK : 0)));
lineTokenizer.advance();
}
return new LineSet(starts.toNativeArray(), flags.toNativeArray(), text.length());
}
Aggregations