18#include <forward_list>
91 duration(duration_), minDuration(minDuration_), maxDuration(maxDuration_) {
96 if (numberActions < 8)
101 constexpr double alpha = 0.25;
103 const double durationOne = durationOfActions / numberActions;
104 duration = Sci::clamp(alpha * durationOne + (1.0 - alpha) * duration,
105 minDuration, maxDuration);
114 durationStyleOneLine(0.00001, 0.000001, 0.0001) {
153 watcher.watcher->NotifyDeleted(
this, watcher.userData);
166 if (curRefCount == 0)
172 for (
const std::unique_ptr<PerLine> &pl :
perLineData) {
179 for (
const std::unique_ptr<PerLine> &pl :
perLineData) {
181 pl->InsertLine(
line);
193 for (
const std::unique_ptr<PerLine> &pl :
perLineData) {
195 pl->RemoveLine(
line);
225 return pli->LineEndTypesSupported();
272 bool multiLine =
false;
275 for (
int step = 0; step < steps; step++) {
306 if (step == steps - 1) {
312 linesAdded, action.
data.get()));
316 if (startSavePoint != endSavePoint)
326 return Markers()->MarkValue(
line);
330 return Markers()->MarkerNext(lineStart, mask);
348 unsigned int m = valueSet;
349 for (
int i = 0; m; i++, m >>= 1) {
371 bool someChanges =
false;
384 return Markers()->LineFromHandle(markerHandle);
388 return Markers()->NumberFromLine(
line, which);
392 return Markers()->HandleFromLine(
line, which);
409 const unsigned char bytes[] = {
433 watcher.watcher->NotifyErrorOccurred(
this, watcher.userData, status);
443 return cb.LineFromPosition(
pos);
463 while (startText < endLine && (
cb.
CharAt(startText) ==
' ' ||
cb.
CharAt(startText) ==
'\t'))
466 return startPosition;
472 return cb.IndexLineStart(
line, lineCharacterIndex);
476 return cb.LineFromPositionIndex(
pos, lineCharacterIndex);
510 const Sci::Line lookLastLine = (lastLine != -1) ? std::min(
LinesTotal() - 1, lastLine) : -1;
512 while (lineMaxSubord < maxLine - 1) {
520 if (lineMaxSubord > lineParent) {
528 return lineMaxSubord;
534 while ((lineLook > 0) && (
553 int lookLineLevel = level;
557 lookLineLevel =
GetLevel(--lookLine);
562 if (beginFoldBlock == -1) {
563 highlightDelimiter.
Clear();
568 Sci::Line firstChangeableLineBefore = -1;
569 if (endFoldBlock <
line) {
570 lookLine = beginFoldBlock - 1;
576 beginFoldBlock = lookLine;
578 firstChangeableLineBefore =
line - 1;
583 lookLineLevel =
GetLevel(--lookLine);
587 if (firstChangeableLineBefore == -1) {
589 lookLine >= beginFoldBlock;
592 firstChangeableLineBefore = lookLine;
597 if (firstChangeableLineBefore == -1)
598 firstChangeableLineBefore = beginFoldBlock - 1;
602 lookLine <= endFoldBlock;
605 firstChangeableLineAfter = lookLine;
609 if (firstChangeableLineAfter == -1)
610 firstChangeableLineAfter = endFoldBlock + 1;
625 if (
pos >= (LengthNoExcept() - 1))
627 return (cb.CharAt(
pos) ==
'\r') && (cb.CharAt(
pos + 1) ==
'\n');
631 if (pos < 0 || pos >= LengthNoExcept()) {
634 }
else if (IsCrLf(
pos)) {
638 const unsigned char leadByte = cb.UCharAt(
pos);
645 unsigned char charBytes[
UTF8MaxBytes] = { leadByte, 0, 0, 0 };
646 for (
int b = 1; b < widthCharBytes; b++) {
647 charBytes[b] = cb.UCharAt(
pos + b);
649 const int utf8status =
UTF8Classify(charBytes, widthCharBytes);
657 if (IsDBCSLeadByteNoExcept(leadByte) && ((
pos + 1) < LengthNoExcept())) {
669 start = (trail > 0) ? trail-1 : trail;
671 const unsigned char leadByte = cb.UCharAt(start);
673 if (widthCharBytes == 1) {
676 const int trailBytes = widthCharBytes - 1;
678 if (len > trailBytes)
681 unsigned char charBytes[
UTF8MaxBytes] = {leadByte,0,0,0};
682 for (
Sci::Position b=1; b<widthCharBytes && ((start+b) < cb.Length()); b++)
683 charBytes[b] = cb.CharAt(start+b);
684 const int utf8status =
UTF8Classify(charBytes, widthCharBytes);
687 end = start + widthCharBytes;
702 if (
pos >= LengthNoExcept())
703 return LengthNoExcept();
706 if (checkLineEnd && IsCrLf(
pos - 1)) {
715 const unsigned char ch = cb.UCharAt(
pos);
720 if (InGoodUTF8(
pos, startUTF, endUTF)) {
733 if (
pos == posStartLine)
738 while ((posCheck > posStartLine) && IsDBCSLeadByteNoExcept(cb.CharAt(posCheck-1)))
742 while (posCheck <
pos) {
743 const int mbsize = IsDBCSLeadByteNoExcept(cb.CharAt(posCheck)) ? 2 : 1;
744 if (posCheck + mbsize ==
pos) {
746 }
else if (posCheck + mbsize >
pos) {
748 return posCheck + mbsize;
766 const int increment = (moveDir > 0) ? 1 : -1;
767 if (
pos + increment <= 0)
769 if (
pos + increment >= cb.Length())
774 if (increment == 1) {
776 const unsigned char leadByte = cb.UCharAt(
pos);
782 unsigned char charBytes[
UTF8MaxBytes] = {leadByte,0,0,0};
783 for (
int b=1; b<widthCharBytes; b++)
784 charBytes[b] = cb.CharAt(
pos+b);
785 const int utf8status =
UTF8Classify(charBytes, widthCharBytes);
794 const unsigned char ch = cb.UCharAt(
pos);
800 if (InGoodUTF8(
pos, startUTF, endUTF)) {
808 const int mbsize = IsDBCSLeadByteNoExcept(cb.CharAt(
pos)) ? 2 : 1;
810 if (
pos > cb.Length())
818 if ((
pos - 1) <= posStartLine) {
820 }
else if (IsDBCSLeadByteNoExcept(cb.CharAt(
pos - 1))) {
826 while (posStartLine <= --posTemp && IsDBCSLeadByteNoExcept(cb.CharAt(posTemp)))
831 return (
pos - 1 - ((
pos - posTemp) & 1));
845 if (posNext ==
pos) {
857 const unsigned char leadByte = cb.UCharAt(
position);
864 unsigned char charBytes[
UTF8MaxBytes] = { leadByte, 0, 0, 0 };
865 for (
int b = 1; b<widthCharBytes; b++)
866 charBytes[b] = cb.UCharAt(
position + b);
867 const int utf8status =
UTF8Classify(charBytes, widthCharBytes);
875 if (IsDBCSLeadByteNoExcept(leadByte) && ((
position + 1) < LengthNoExcept())) {
876 return CharacterExtracted::DBCS(leadByte, cb.UCharAt(
position + 1));
887 const unsigned char previousByte = cb.UCharAt(
position - 1);
888 if (0 == dbcsCodePage) {
901 if (InGoodUTF8(
position, startUTF, endUTF)) {
905 charBytes[b] = cb.UCharAt(startUTF + b);
906 const int utf8status =
UTF8Classify(charBytes, widthCharBytes);
920 return CharacterAfter(posStartCharacter);
928 const int increment = (characterOffset > 0) ? 1 : -1;
929 while (characterOffset != 0) {
934 characterOffset -= increment;
937 pos = positionStart + characterOffset;
947 const int increment = (characterOffset > 0) ? 1 : -1;
948 while (characterOffset != 0) {
952 if (std::abs(
pos-posNext) > 3)
953 characterOffset -= increment;
955 characterOffset -= increment;
958 pos = positionStart + characterOffset;
959 if ((
pos < 0) || (
pos > LengthNoExcept()))
967 int bytesInCharacter = 1;
976 unsigned char charBytes[
UTF8MaxBytes] = {leadByte,0,0,0};
977 for (
int b=1; b<widthCharBytes; b++)
979 const int utf8status =
UTF8Classify(charBytes, widthCharBytes);
990 bytesInCharacter = 2;
1000 *pWidth = bytesInCharacter;
1017 const unsigned char uch = ch;
1018 switch (dbcsCodePage) {
1021 return ((uch >= 0x81) && (uch <= 0x9F)) ||
1022 ((uch >= 0xE0) && (uch <= 0xFC));
1026 return (uch >= 0x81) && (uch <= 0xFE);
1029 return (uch >= 0x81) && (uch <= 0xFE);
1032 return (uch >= 0x81) && (uch <= 0xFE);
1036 ((uch >= 0x84) && (uch <= 0xD3)) ||
1037 ((uch >= 0xD8) && (uch <= 0xDE)) ||
1038 ((uch >= 0xE0) && (uch <= 0xF9));
1044 const unsigned char lead = ch;
1045 switch (dbcsCodePage) {
1059 return (lead == 0x80) || (lead == 0xFF);
1062 return (lead == 0x80) || (lead == 0xC9) || (lead >= 0xFE);
1066 ((lead >= 0x80) && (lead <= 0xA0)) ||
1072 ((lead >= 0x80) && (lead <= 0x83)) ||
1073 ((lead >= 0xD4) && (lead <= 0xD8)) ||
1081 const unsigned char trail = ch;
1082 switch (dbcsCodePage) {
1099 ((trail >= 0x5B) && (trail <= 0x60)) ||
1100 ((trail >= 0x7B) && (trail <= 0x80)) ||
1106 ((trail >= 0x7F) && (trail <= 0xA0)) ||
1123 if (IsDBCSLeadByteNoExcept(
text[0])) {
1124 return IsDBCSTrailByteInvalid(
text[1]) ? 1 : 2;
1131 return ch ==
' ' || ch ==
'\t';
1146 if (length <= lengthSegment)
1148 int lastSpaceBreak = -1;
1149 int lastPunctuationBreak = -1;
1150 int lastEncodingAllowedBreak = 0;
1151 for (
int j=0; j < lengthSegment;) {
1152 const unsigned char ch =
text[j];
1158 lastPunctuationBreak = j;
1161 lastEncodingAllowedBreak = j;
1165 }
else if (dbcsCodePage) {
1166 j += IsDBCSLeadByteNoExcept(ch) ? 2 : 1;
1171 if (lastSpaceBreak >= 0) {
1172 return lastSpaceBreak;
1173 }
else if (lastPunctuationBreak >= 0) {
1174 return lastPunctuationBreak;
1176 return lastEncodingAllowedBreak;
1189 if (endStyled >
pos)
1224 bool startSequence =
false;
1247 if (insertLength <= 0) {
1276 bool startSequence =
false;
1290 return insertLength;
1302 }
catch (std::bad_alloc &) {
1321 bool multiLine =
false;
1328 for (
int step = 0; step < steps; step++) {
1339 coalescedRemovePos = -1;
1340 coalescedRemoveLen = 0;
1341 prevRemoveActionPos = -1;
1342 prevRemoveActionLen = 0;
1359 if ((coalescedRemoveLen > 0) &&
1360 (action.
position == prevRemoveActionPos || action.
position == (prevRemoveActionPos + prevRemoveActionLen))) {
1361 coalescedRemoveLen += action.
lenData;
1362 newPos = coalescedRemovePos + coalescedRemoveLen;
1364 coalescedRemovePos = action.
position;
1365 coalescedRemoveLen = action.
lenData;
1367 prevRemoveActionPos = action.
position;
1368 prevRemoveActionLen = action.
lenData;
1371 coalescedRemovePos = -1;
1372 coalescedRemoveLen = 0;
1373 prevRemoveActionPos = -1;
1374 prevRemoveActionLen = 0;
1379 if (linesAdded != 0)
1381 if (step == steps - 1) {
1387 linesAdded, action.
data.get()));
1391 if (startSavePoint != endSavePoint)
1406 bool multiLine =
false;
1408 for (
int step = 0; step < steps; step++) {
1438 if (linesAdded != 0)
1440 if (step == steps - 1) {
1447 linesAdded, action.
data.get()));
1451 if (startSavePoint != endSavePoint)
1477 return ((
pos / tabSize) + 1) * tabSize;
1482 if (!insertSpaces) {
1483 while (
indent >= tabSize) {
1504 else if (ch ==
'\t')
1517 if (
indent != indentOfLine) {
1522 DeleteChars(thisLineStart, indentPos - thisLineStart);
1523 return thisLineStart +
InsertString(thisLineStart, linebuf.c_str(),
1550 }
else if (ch ==
'\r') {
1552 }
else if (ch ==
'\n') {
1554 }
else if (i >=
Length()) {
1566 startPos = MovePositionOutsideChar(startPos, 1,
false);
1567 endPos = MovePositionOutsideChar(endPos, -1,
false);
1570 while (i < endPos) {
1572 i = NextPosition(i, 1);
1578 startPos = MovePositionOutsideChar(startPos, 1,
false);
1579 endPos = MovePositionOutsideChar(endPos, -1,
false);
1582 while (i < endPos) {
1600 if (columnCurrent > column)
1603 }
else if (ch ==
'\r') {
1605 }
else if (ch ==
'\n') {
1634 for (
size_t i = 0; (i < len) && (s[i]); i++) {
1635 if (s[i] ==
'\n' || s[i] ==
'\r') {
1637 dest.push_back(
'\r');
1638 }
else if (eolModeWanted ==
SC_EOL_LF) {
1639 dest.push_back(
'\n');
1641 dest.push_back(
'\r');
1642 dest.push_back(
'\n');
1644 if ((s[i] ==
'\r') && (i+1 < len) && (s[i+1] ==
'\n')) {
1648 dest.push_back(s[i]);
1700 while (currentChar < endLine) {
1805 if (!onlyWordCharacters) {
1967 return (!
word && !wordStart) ||
1973 return pcf !=
nullptr;
1981 const unsigned char leadByte = cb.UCharAt(
position);
1987 unsigned char charBytes[
UTF8MaxBytes] = { leadByte, 0, 0, 0 };
1988 for (
int b=1; b<widthCharBytes; b++)
1989 charBytes[b] = cb.UCharAt(
position + b);
1990 const int utf8status =
UTF8Classify(charBytes, widthCharBytes);
2015 return regex->FindText(
this, minPos, maxPos, search, caseSensitive,
word, wordStart, flags, length);
2018 const bool forward = minPos <= maxPos;
2019 const int increment = forward ? 1 : -1;
2035 if (caseSensitive) {
2036 const Sci::Position endSearch = (startPos <= endPos) ? endPos - lengthFind + 1 : endPos;
2037 const char charStartSearch = search[0];
2038 while (forward ? (
pos < endSearch) : (
pos >= endSearch)) {
2040 bool found = (
pos + lengthFind) <= limitPos;
2041 for (
int indexSearch = 1; (indexSearch < lengthFind) && found; indexSearch++) {
2042 found =
CharAt(
pos + indexSearch) == search[indexSearch];
2052 constexpr size_t maxFoldingExpansion = 4;
2053 std::vector<char> searchThing((lengthFind+1) *
UTF8MaxBytes * maxFoldingExpansion + 1);
2054 const size_t lenSearch =
2055 pcf->Fold(&searchThing[0], searchThing.size(), search, lengthFind);
2057 char folded[
UTF8MaxBytes * maxFoldingExpansion + 1] =
"";
2058 while (forward ? (
pos < endPos) : (
pos >= endPos)) {
2059 int widthFirstCharacter = 0;
2061 size_t indexSearch = 0;
2062 bool characterMatches =
true;
2064 const unsigned char leadByte =
cb.
UCharAt(posIndexDocument);
2065 bytes[0] = leadByte;
2069 for (
int b=1; b<widthCharBytes; b++) {
2074 if (!widthFirstCharacter)
2075 widthFirstCharacter = widthChar;
2076 if ((posIndexDocument + widthChar) > limitPos)
2078 const size_t lenFlat =
pcf->Fold(folded,
sizeof(folded),
bytes, widthChar);
2080 assert((indexSearch + lenFlat) <= searchThing.size());
2082 characterMatches = 0 == memcmp(folded, &searchThing[0] + indexSearch, lenFlat);
2083 if (!characterMatches)
2085 posIndexDocument += widthChar;
2086 indexSearch += lenFlat;
2087 if (indexSearch >= lenSearch)
2090 if (characterMatches && (indexSearch == lenSearch)) {
2092 *length = posIndexDocument -
pos;
2097 pos += widthFirstCharacter;
2104 constexpr size_t maxBytesCharacter = 2;
2105 constexpr size_t maxFoldingExpansion = 4;
2106 std::vector<char> searchThing((lengthFind+1) * maxBytesCharacter * maxFoldingExpansion + 1);
2107 const size_t lenSearch =
pcf->Fold(&searchThing[0], searchThing.size(), search, lengthFind);
2108 while (forward ? (
pos < endPos) : (
pos >= endPos)) {
2110 size_t indexSearch = 0;
2111 bool characterMatches =
true;
2112 while (characterMatches &&
2113 ((
pos + indexDocument) < limitPos) &&
2114 (indexSearch < lenSearch)) {
2115 char bytes[maxBytesCharacter + 1];
2120 if ((
pos + indexDocument + widthChar) > limitPos)
2122 char folded[maxBytesCharacter * maxFoldingExpansion + 1];
2123 const size_t lenFlat =
pcf->Fold(folded,
sizeof(folded),
bytes, widthChar);
2125 assert((indexSearch + lenFlat) <= searchThing.size());
2127 characterMatches = 0 == memcmp(folded, &searchThing[0] + indexSearch, lenFlat);
2128 indexDocument += widthChar;
2129 indexSearch += lenFlat;
2131 if (characterMatches && (indexSearch == lenSearch)) {
2133 *length = indexDocument;
2141 const Sci::Position endSearch = (startPos <= endPos) ? endPos - lengthFind + 1 : endPos;
2142 std::vector<char> searchThing(lengthFind + 1);
2143 pcf->Fold(&searchThing[0], searchThing.size(), search, lengthFind);
2144 while (forward ? (
pos < endSearch) : (
pos >= endSearch)) {
2145 bool found = (
pos + lengthFind) <= limitPos;
2146 for (
int indexSearch = 0; (indexSearch < lengthFind) && found; indexSearch++) {
2147 const char ch =
CharAt(
pos + indexSearch);
2149 pcf->Fold(folded,
sizeof(folded), &ch, 1);
2150 found = folded[0] == searchThing[indexSearch];
2166 return regex->SubstituteByPosition(
this,
text, length);
2219 prevEndStyled, length);
2233 bool didChange =
false;
2236 for (
int iPos = 0; iPos < length; iPos++,
endStyled++) {
2248 startMod, endMod - startMod + 1);
2259 if (
pli && !
pli->UseContainerLexing()) {
2262 pli->Colourise(endStyledTo,
pos);
2265 for (std::vector<WatcherWithUserData>::iterator it =
watchers.begin();
2267 it->watcher->NotifyStyleNeeded(
this, it->userData,
pos);
2284 watcher.watcher->NotifyLexerChanged(
this, watcher.userData);
2293 pli = std::move(pLexInterface);
2298 if (state != statePrevious) {
2303 return statePrevious;
2316 end-start, 0, 0, 0);
2347 for (
Sci::Line l=0; l<maxEditorLine; l++)
2387 return Annotations()->Lines(
line);
2392 for (
Sci::Line l=0; l<maxEditorLine; l++)
2424 for (
Sci::Line l=0; l<maxEditorLine; l++)
2450 std::vector<WatcherWithUserData>::iterator it =
2459 std::vector<WatcherWithUserData>::iterator it =
2470 watcher.watcher->NotifyModifyAttempt(
this, watcher.userData);
2476 watcher.watcher->NotifySavePoint(
this, watcher.userData, atSavePoint);
2487 watcher.watcher->NotifyModified(
this, mh, watcher.userData);
2627 return (c ==
'\n' || c ==
'\r');
2631 const int sStart = cb.StyleAt(
pos);
2637 while (
pos < (LengthNoExcept()) && (cb.StyleAt(
pos) == sStart) && (!singleLine || !
IsLineEndChar(cb.CharAt(
pos))))
2668 const char chBrace = CharAt(
position);
2672 const int styBrace = StyleIndexAt(
position);
2674 if (chBrace ==
'(' || chBrace ==
'[' || chBrace ==
'{' || chBrace ==
'<')
2679 const char chAtPos = CharAt(
position);
2680 const int styAtPos = StyleIndexAt(
position);
2681 if ((
position > GetEndStyled()) || (styAtPos == styBrace)) {
2682 if (chAtPos == chBrace)
2684 if (chAtPos == chSeek)
2691 if (
position == positionBeforeMove)
2710 bool caseSensitive,
bool word,
bool wordStart,
int flags,
2725class RESearchRange {
2735 increment = (minPos <= maxPos) ? 1 : -1;
2744 lineRangeBreak = lineRangeEnd + increment;
2748 if (increment == 1) {
2749 if (
line == lineRangeStart)
2750 range.
start = startPos;
2751 if (
line == lineRangeEnd)
2754 if (
line == lineRangeEnd)
2755 range.
start = endPos;
2756 if (
line == lineRangeStart)
2757 range.
end = startPos;
2769 pdoc(pdoc_), end(end_) {
2772 DocumentIndexer(
const DocumentIndexer &) =
delete;
2773 DocumentIndexer(DocumentIndexer &&) =
delete;
2774 DocumentIndexer &operator=(
const DocumentIndexer &) =
delete;
2775 DocumentIndexer &operator=(DocumentIndexer &&) =
delete;
2777 ~DocumentIndexer()
override =
default;
2780 if (index < 0 || index >= end)
2787#ifndef NO_CXX11_REGEX
2791 typedef std::bidirectional_iterator_tag iterator_category;
2792 typedef char value_type;
2793 typedef ptrdiff_t difference_type;
2794 typedef char* pointer;
2795 typedef char& reference;
2803 ByteIterator(
const ByteIterator &other)
noexcept {
2807 ByteIterator(ByteIterator &&other)
noexcept {
2811 ByteIterator &operator=(
const ByteIterator &other)
noexcept {
2812 if (
this != &other) {
2818 ByteIterator &operator=(ByteIterator &&) noexcept =
default;
2820 char operator*() const noexcept {
2823 ByteIterator &operator++() noexcept {
2827 ByteIterator operator++(
int)
noexcept {
2828 ByteIterator retVal(*
this);
2832 ByteIterator &operator--() noexcept {
2836 bool operator==(
const ByteIterator &other)
const noexcept {
2837 return doc == other.doc &&
position == other.position;
2839 bool operator!=(
const ByteIterator &other)
const noexcept {
2840 return doc != other.doc ||
position != other.position;
2857#define WCHAR_T_IS_16 1
2859#define WCHAR_T_IS_16 0
2870 size_t characterIndex;
2872 unsigned int lenBytes;
2873 size_t lenCharacters;
2874 wchar_t buffered[2];
2876 typedef std::bidirectional_iterator_tag iterator_category;
2877 typedef wchar_t value_type;
2878 typedef ptrdiff_t difference_type;
2879 typedef wchar_t* pointer;
2880 typedef wchar_t& reference;
2883 doc(doc_),
position(position_), characterIndex(0), lenBytes(0), lenCharacters(0), buffered{} {
2890 UTF8Iterator(
const UTF8Iterator &other) noexcept : buffered{} {
2893 characterIndex = other.characterIndex;
2894 lenBytes = other.lenBytes;
2895 lenCharacters = other.lenCharacters;
2896 buffered[0] = other.buffered[0];
2897 buffered[1] = other.buffered[1];
2899 UTF8Iterator(UTF8Iterator &&other)
noexcept =
default;
2900 UTF8Iterator &operator=(
const UTF8Iterator &other)
noexcept {
2901 if (
this != &other) {
2904 characterIndex = other.characterIndex;
2905 lenBytes = other.lenBytes;
2906 lenCharacters = other.lenCharacters;
2907 buffered[0] = other.buffered[0];
2908 buffered[1] = other.buffered[1];
2912 UTF8Iterator &operator=(UTF8Iterator &&)
noexcept =
default;
2913 ~UTF8Iterator() =
default;
2914 wchar_t operator*()
const noexcept {
2915 assert(lenCharacters != 0);
2916 return buffered[characterIndex];
2918 UTF8Iterator &operator++()
noexcept {
2919 if ((characterIndex + 1) < (lenCharacters)) {
2928 UTF8Iterator operator++(
int)
noexcept {
2929 UTF8Iterator retVal(*
this);
2930 if ((characterIndex + 1) < (lenCharacters)) {
2939 UTF8Iterator &operator--()
noexcept {
2940 if (characterIndex) {
2945 characterIndex = lenCharacters - 1;
2949 bool operator==(
const UTF8Iterator &other)
const noexcept {
2951 return doc == other.doc &&
2953 characterIndex == other.characterIndex;
2955 bool operator!=(
const UTF8Iterator &other)
const noexcept {
2957 return doc != other.doc ||
2959 characterIndex != other.characterIndex;
2971 void ReadCharacter()
noexcept {
2976 buffered[0] =
static_cast<wchar_t>(charExtracted.
character);
2991 typedef std::bidirectional_iterator_tag iterator_category;
2992 typedef wchar_t value_type;
2993 typedef ptrdiff_t difference_type;
2994 typedef wchar_t* pointer;
2995 typedef wchar_t& reference;
3000 UTF8Iterator(
const UTF8Iterator &other)
noexcept {
3004 UTF8Iterator(UTF8Iterator &&other)
noexcept =
default;
3005 UTF8Iterator &operator=(
const UTF8Iterator &other)
noexcept {
3006 if (
this != &other) {
3012 UTF8Iterator &operator=(UTF8Iterator &&) noexcept =
default;
3014 wchar_t operator*() const noexcept {
3018 UTF8Iterator &operator++() noexcept {
3022 UTF8Iterator operator++(
int)
noexcept {
3023 UTF8Iterator retVal(*
this);
3027 UTF8Iterator &operator--() noexcept {
3031 bool operator==(
const UTF8Iterator &other)
const noexcept {
3032 return doc == other.doc &&
position == other.position;
3034 bool operator!=(
const UTF8Iterator &other)
const noexcept {
3035 return doc != other.doc ||
position != other.position;
3048 std::regex_constants::match_flag_type flagsMatch = std::regex_constants::match_default;
3050 flagsMatch |= std::regex_constants::match_not_bol;
3052 flagsMatch |= std::regex_constants::match_not_eol;
3056template<
typename Iterator,
typename Regex>
3057bool MatchOnLines(
const Document *doc,
const Regex ®exp,
const RESearchRange &resr,
RESearch &search) {
3058 std::match_results<Iterator>
match;
3067#ifdef REGEX_MULTILINE
3068 Iterator itStart(doc, resr.startPos);
3069 Iterator itEnd(doc, resr.endPos);
3070 const std::regex_constants::match_flag_type flagsMatch = MatchFlags(doc, resr.startPos, resr.endPos);
3071 const bool matched = std::regex_search(itStart, itEnd,
match, regexp, flagsMatch);
3074 bool matched =
false;
3076 const Range lineRange = resr.LineRange(
line);
3077 Iterator itStart(doc, lineRange.
start);
3078 Iterator itEnd(doc, lineRange.
end);
3079 std::regex_constants::match_flag_type flagsMatch = MatchFlags(doc, lineRange.
start, lineRange.
end);
3080 matched = std::regex_search(itStart, itEnd,
match, regexp, flagsMatch);
3083 if (resr.increment == -1) {
3085 Iterator itNext(doc,
match[0].second.PosRoundUp());
3086 flagsMatch = MatchFlags(doc, itNext.Pos(), lineRange.
end);
3087 std::match_results<Iterator> matchNext;
3088 matched = std::regex_search(itNext, itEnd, matchNext, regexp, flagsMatch);
3104 for (
size_t co = 0; co <
match.size(); co++) {
3106 search.
eopat[co] =
match[co].second.PosRoundUp();
3108 search.
pat[co].resize(lenMatch);
3119 const RESearchRange resr(doc, minPos, maxPos);
3122 std::regex::flag_type flagsRe = std::regex::ECMAScript;
3126 flagsRe = flagsRe | std::regex::icase;
3131 bool matched =
false;
3135 regexp.assign(ws, flagsRe);
3136 matched = MatchOnLines<UTF8Iterator>(doc, regexp, resr, search);
3140 regexp.assign(s, flagsRe);
3141 matched = MatchOnLines<ByteIterator>(doc, regexp, resr, search);
3146 posMatch = search.
bopat[0];
3155 }
catch (std::regex_error &) {
3169 bool caseSensitive,
bool,
bool,
int flags,
3172#ifndef NO_CXX11_REGEX
3174 return Cxx11RegexFindText(doc, minPos, maxPos, s,
3175 caseSensitive, length, search);
3179 const RESearchRange resr(doc, minPos, maxPos);
3183 const char *errmsg = search.
Compile(s, *length, caseSensitive, posix);
3193 const bool searchforLineStart = s[0] ==
'^';
3194 const char searchEnd = s[*length - 1];
3195 const char searchEndPrev = (*length > 1) ? s[*length - 2] :
'\0';
3196 const bool searchforLineEnd = (searchEnd ==
'$') && (searchEndPrev !=
'\\');
3200 if (resr.increment == 1) {
3201 if (
line == resr.lineRangeStart) {
3202 if ((resr.startPos != startOfLine) && searchforLineStart)
3204 startOfLine = resr.startPos;
3206 if (
line == resr.lineRangeEnd) {
3207 if ((resr.endPos != endOfLine) && searchforLineEnd)
3209 endOfLine = resr.endPos;
3212 if (
line == resr.lineRangeEnd) {
3213 if ((resr.endPos != startOfLine) && searchforLineStart)
3215 startOfLine = resr.endPos;
3217 if (
line == resr.lineRangeStart) {
3218 if ((resr.startPos != endOfLine) && searchforLineEnd)
3220 endOfLine = resr.startPos;
3224 const DocumentIndexer di(doc, endOfLine);
3225 int success = search.
Execute(di, startOfLine, endOfLine);
3232 if ((resr.increment == -1) && !searchforLineStart) {
3234 int repetitions = 1000;
3235 while (success && (search.
eopat[0] <= endOfLine) && (repetitions--)) {
3236 success = search.
Execute(di,
pos+1, endOfLine);
3238 if (search.
eopat[0] <= minPos) {
3255 substituted.clear();
3256 const DocumentIndexer di(doc, doc->
Length());
3259 if (
text[j] ==
'\\') {
3260 if (
text[j + 1] >=
'0' &&
text[j + 1] <=
'9') {
3261 const unsigned int patNum =
text[j + 1] -
'0';
3263 if (!search.
pat[patNum].empty())
3264 substituted.append(search.
pat[patNum].c_str(), len);
3270 substituted.push_back(
'\a');
3273 substituted.push_back(
'\b');
3276 substituted.push_back(
'\f');
3279 substituted.push_back(
'\n');
3282 substituted.push_back(
'\r');
3285 substituted.push_back(
'\t');
3288 substituted.push_back(
'\v');
3291 substituted.push_back(
'\\');
3294 substituted.push_back(
'\\');
3299 substituted.push_back(
text[j]);
3302 *length = substituted.length();
3303 return substituted.c_str();
Classes for case folding.
Manages the text of the document.
Character classifications used by Document and RESearch.
Returns the Unicode general category of a character.
Encapsulates a set of characters.
Visual elements added over text.
static constexpr bool IsLineEndChar(char c) noexcept
static std::string CreateIndentation(Sci::Position indent, int tabSize, bool insertSpaces)
static char BraceOpposite(char ch) noexcept
static bool IsSubordinate(int levelStart, int levelTry) noexcept
static bool IsASCIIPunctuationCharacter(unsigned int ch) noexcept
static constexpr Sci::Position NextTab(Sci::Position pos, Sci::Position tabSize) noexcept
Text document that handles notifications, DBCS, styling, words and end of line.
Encapsulate C++ <chrono> to simplify use.
Interface between Scintilla and lexers.
Interface for loading into a Scintilla document from a background thread.
Data structure used to partition an interval.
Manages data associated with each line of the document.
Defines global type name Position in the Sci internal namespace.
Interface to the regular expression search library.
Data structure used to store sparse styles.
Interface to the edit control.
#define SC_MOD_CHANGEMARGIN
#define SC_MOD_INSERTTEXT
#define SC_DOCUMENTOPTION_TEXT_LARGE
#define SC_MOD_CHANGEINDICATOR
#define SC_MOD_LEXERSTATE
#define SC_MOD_CHANGEFOLD
#define SCFIND_CXX11REGEX
#define SC_LASTSTEPINUNDOREDO
#define SC_STATUS_BADALLOC
#define SC_MOD_CHANGELINESTATE
#define SC_PERFORMED_REDO
#define SC_PERFORMED_UNDO
#define SC_MOD_CHANGESTYLE
#define SC_MOD_INSERTCHECK
#define SC_MOD_BEFOREINSERT
#define SC_LINE_END_TYPE_UNICODE
#define SC_MOD_CHANGEANNOTATION
#define SC_MULTILINEUNDOREDO
#define SC_LINE_END_TYPE_DEFAULT
#define SC_FOLDLEVELWHITEFLAG
#define SC_MOD_CHANGEMARKER
#define SC_MOD_CHANGEEOLANNOTATION
#define SC_MOD_DELETETEXT
#define SC_FOLDLEVELHEADERFLAG
#define SC_MULTISTEPUNDOREDO
#define SC_STATUS_FAILURE
#define SC_DOCUMENTOPTION_STYLES_NONE
#define SC_MOD_BEFOREDELETE
#define SC_PERFORMED_USER
Main data structure for holding arrays that handle insertions and deletions efficiently.
Functions to handle UTF-8 and UTF-16 strings.
Implementation of RegexSearchBase for the default built-in regular expression engine.
BuiltinRegex(CharClassify *charClassTable)
const char * SubstituteByPosition(Document *doc, const char *text, Sci::Position *length) override
~BuiltinRegex() override=default
BuiltinRegex & operator=(const BuiltinRegex &)=delete
BuiltinRegex & operator=(BuiltinRegex &&)=delete
BuiltinRegex(BuiltinRegex &&)=delete
Sci::Position FindText(Document *doc, Sci::Position minPos, Sci::Position maxPos, const char *s, bool caseSensitive, bool word, bool wordStart, int flags, Sci::Position *length) override
BuiltinRegex(const BuiltinRegex &)=delete
void AddSample(size_t numberActions, double durationOfActions) noexcept
double Duration() const noexcept
ActionDuration(double duration_, double minDuration_, double maxDuration_) noexcept
Actions are used to store all the information required to perform one undo/redo step.
std::unique_ptr< char[]> data
void ReleaseLineCharacterIndex(int lineCharacterIndex)
int TentativeSteps() noexcept
bool IsSavePoint() const noexcept
unsigned char UCharAt(Sci::Position position) const noexcept
bool SetStyleAt(Sci::Position position, char styleValue) noexcept
Setting styles for positions outside the range of the buffer is safe and has no effect.
void SetSavePoint()
The save point is a marker in the undo stack where the container has stated that the buffer was saved...
Sci::Line LineFromPosition(Sci::Position pos) const noexcept
bool IsCollectingUndo() const noexcept
bool HasStyles() const noexcept
void SetLineEndTypes(int utf8LineEnds_)
int GetLineEndTypes() const noexcept
const char * DeleteChars(Sci::Position position, Sci::Position deleteLength, bool &startSequence)
void SetUTF8Substance(bool utf8Substance_) noexcept
int LineCharacterIndex() const noexcept
void SetPerLine(PerLine *pl) noexcept
char CharAt(Sci::Position position) const noexcept
Retrieving positions outside the range of the buffer works and returns 0.
const Action & GetRedoStep() const
const char * InsertString(Sci::Position position, const char *s, Sci::Position insertLength, bool &startSequence)
bool SetStyleFor(Sci::Position position, Sci::Position lengthStyle, char styleValue) noexcept
bool IsReadOnly() const noexcept
Sci::Line Lines() const noexcept
const Action & GetUndoStep() const
Sci::Position LineStart(Sci::Line line) const noexcept
void AllocateLineCharacterIndex(int lineCharacterIndex)
cc GetClass(unsigned char ch) const noexcept
void SetDefaultCharClasses(bool includeWordClass)
void SetCharClasses(const unsigned char *chars, cc newCharClass)
int GetCharsOfClass(cc characterClass, unsigned char *buffer) const noexcept
void Optimize(int countCharacters)
CharacterCategory CategoryFor(int character) const
int Size() const noexcept
To optimise processing of document modifications by DocWatchers, a hint is passed indicating the scop...
Sci::Line annotationLinesAdded
A class that wants to receive notifications from a Document must be derived from DocWatcher and imple...
Sci::Position NextPosition(Sci::Position pos, int moveDir) const noexcept
bool DeleteChars(Sci::Position pos, Sci::Position len)
Sci::Position NextWordEnd(Sci::Position pos, int delta) const
Find the end of the next word in either a forward (delta >= 0) or backwards direction (delta < 0).
bool HasCaseFolder() const noexcept
Sci::Line SciLineFromPosition(Sci::Position pos) const noexcept
void InsertLines(Sci::Line line, Sci::Line lines) override
char SCI_METHOD StyleAt(Sci_Position position) const override
std::unique_ptr< PerLine > perLineData[ldSize]
int SCI_METHOD GetLineState(Sci_Position line) const override
void EnsureStyledTo(Sci::Position pos)
Sci::Position FindColumn(Sci::Line line, Sci::Position column)
Sci::Line LineFromHandle(int markerHandle) const noexcept
void IncrementStyleClock() noexcept
void SetCharacterCategoryOptimization(int countCharacters)
CharacterCategoryMap charMap
Sci_Position SCI_METHOD Length() const override
Sci::Position MovePositionOutsideChar(Sci::Position pos, Sci::Position moveDir, bool checkLineEnd=true) const noexcept
int dbcsCodePage
Can also be SC_CP_UTF8 to enable UTF-8 mode.
void SCI_METHOD ChangeLexerState(Sci_Position start, Sci_Position end) override
bool InGoodUTF8(Sci::Position pos, Sci::Position &start, Sci::Position &end) const noexcept
Sci::Position SetLineIndentation(Sci::Line line, Sci::Position indent)
char CharAt(Sci::Position position) const noexcept
CharClassify::cc WordCharacterClass(unsigned int ch) const
void MarginSetStyles(Sci::Line line, const unsigned char *styles)
void SCI_METHOD StartStyling(Sci_Position position, char mask) override
Sci::Line GetFoldParent(Sci::Line line) const
LineMarkers * Markers() const noexcept
void NotifyModifyAttempt()
CharacterExtracted ExtractCharacter(Sci::Position position) const noexcept
void MarginSetText(Sci::Line line, const char *text)
void ChangeInsertion(const char *s, Sci::Position length)
bool IsCrLf(Sci::Position pos) const noexcept
bool IsWhiteLine(Sci::Line line) const
void AnnotationSetStyle(Sci::Line line, int style)
std::unique_ptr< RegexSearchBase > regex
void ReleaseLineCharacterIndex(int lineCharacterIndex)
void AnnotationSetText(Sci::Line line, const char *text)
Sci::Position ExtendWordSelect(Sci::Position pos, int delta, bool onlyWordCharacters=false) const
Used by commands that want to select whole words.
Sci_Position SCI_METHOD LineEnd(Sci_Position line) const override
const char * SubstituteByPosition(const char *text, Sci::Position *length)
void EOLAnnotationSetText(Sci::Line line, const char *text)
bool IsWordPartSeparator(unsigned int ch) const
int LenChar(Sci::Position pos) const noexcept
void NotifySavePoint(bool atSavePoint)
bool IsWordAt(Sci::Position start, Sci::Position end) const
Check that the given range is has transitions between character classes at both ends and where the ch...
Sci::Position GetRelativePositionUTF16(Sci::Position positionStart, Sci::Position characterOffset) const noexcept
Sci::Position InsertString(Sci::Position position, const char *s, Sci::Position insertLength)
Insert a string with a length.
std::unique_ptr< IDecorationList > decorations
int SCI_METHOD Release() override
void SCI_METHOD DecorationFillRange(Sci_Position position, int value, Sci_Position fillLength) override
int AnnotationLines(Sci::Line line) const noexcept
void SetLexInterface(std::unique_ptr< LexInterface > pLexInterface) noexcept
Sci::Position GetEndStyled() const noexcept
void ConvertLineEnds(int eolModeSet)
bool IsLarge() const noexcept
Sci::Position ClampPositionIntoDocument(Sci::Position pos) const noexcept
void SCI_METHOD DecorationSetCurrentIndicator(int indicator) override
Sci::Position VCHomePosition(Sci::Position position) const
int SCI_METHOD GetLevel(Sci_Position line) const override
std::vector< WatcherWithUserData > watchers
void DelChar(Sci::Position pos)
Sci::Position WordPartLeft(Sci::Position pos) const
Sci::Line GetLastChild(Sci::Line lineParent, int level=-1, Sci::Line lastLine=-1)
StyledText MarginStyledText(Sci::Line line) const noexcept
Sci::Position ParaDown(Sci::Position pos) const
Sci::Position ParaUp(Sci::Position pos) const
LineState * States() const noexcept
int GetMark(Sci::Line line) const noexcept
int SCI_METHOD SetLevel(Sci_Position line, int level) override
static std::string TransformLineEnds(const char *s, size_t len, int eolModeWanted)
bool IsLineStartPosition(Sci::Position position) const
void GetHighlightDelimiters(HighlightDelimiter &highlightDelimiter, Sci::Line line, Sci::Line lastLine)
void StyleToAdjustingLineDuration(Sci::Position pos)
void SetCharClasses(const unsigned char *chars, CharClassify::cc newCharClass)
LineAnnotation * Margins() const noexcept
StyledText AnnotationStyledText(Sci::Line line) const noexcept
bool TentativeActive() const noexcept
Sci::Position IndexLineStart(Sci::Line line, int lineCharacterIndex) const noexcept
void EOLAnnotationClearAll()
LexInterface * GetLexInterface() const noexcept
Sci::Position LengthNoExcept() const noexcept
bool AddWatcher(DocWatcher *watcher, void *userData)
void *SCI_METHOD ConvertToDocument() override
int SCI_METHOD AddData(const char *data, Sci_Position length) override
int IndentSize() const noexcept
ActionDuration durationStyleOneLine
int MarkerNumberFromLine(Sci::Line line, int which) const noexcept
void RemoveLine(Sci::Line line) override
bool IsWordStartAt(Sci::Position pos) const
Check that the character at the given position is a word or punctuation character and that the previo...
Document::CharacterExtracted CharacterAfter(Sci::Position position) const noexcept
void InsertLine(Sci::Line line) override
bool IsLineEndPosition(Sci::Position position) const
int LineEndTypesSupported() const
bool IsDBCSLeadByteInvalid(char ch) const noexcept
void DelCharBack(Sci::Position pos)
Sci::Position WordPartRight(Sci::Position pos) const
Sci::Line GetMaxLineState() const noexcept
int AddMark(Sci::Line line, int markerNum)
Sci_Position SCI_METHOD GetRelativePosition(Sci_Position positionStart, Sci_Position characterOffset) const override
Sci::Line LinesTotal() const noexcept
bool IsPositionInLineEnd(Sci::Position position) const
bool SetDBCSCodePage(int dbcsCodePage_)
int Options() const noexcept
bool SetLineEndTypesAllowed(int lineEndBitSet_)
LineLevels * Levels() const noexcept
int SCI_METHOD GetCharacterAndWidth(Sci_Position position, Sci_Position *pWidth) const override
int LineCharacterIndex() const noexcept
void ModifiedAt(Sci::Position pos) noexcept
bool MatchesWordOptions(bool word, bool wordStart, Sci::Position pos, Sci::Position length) const
int SafeSegment(const char *text, int length, int lengthSegment) const noexcept
int MarkerHandleFromLine(Sci::Line line, int which) const noexcept
void SCI_METHOD SetErrorStatus(int status) override
bool SCI_METHOD SetStyleFor(Sci_Position length, char style) override
bool SCI_METHOD SetStyles(Sci_Position length, const char *styles) override
int CharacterCategoryOptimization() const noexcept
Sci::Position BraceMatch(Sci::Position position, Sci::Position maxReStyle, Sci::Position startPos, bool useStartPos) noexcept
Sci::Position LineEndPosition(Sci::Position position) const
Sci::Position GetLineIndentPosition(Sci::Line line) const
bool IsWordEndAt(Sci::Position pos) const
Check that the character at the given position is a word or punctuation character and that the next c...
StyledText EOLAnnotationStyledText(Sci::Line line) const noexcept
void DeleteAllMarks(int markerNum)
std::unique_ptr< CaseFolder > pcf
LineAnnotation * Annotations() const noexcept
bool IsDBCSTrailByteInvalid(char ch) const noexcept
void MarginSetStyle(Sci::Line line, int style)
void SetDefaultCharClasses(bool includeWordClass)
void DeleteMark(Sci::Line line, int markerNum)
void AddMarkSet(Sci::Line line, int valueSet)
int DBCSDrawBytes(const char *text, int len) const noexcept
bool NextCharacter(Sci::Position &pos, int moveDir) const noexcept
LineAnnotation * EOLAnnotations() const noexcept
int GetCharsOfClass(CharClassify::cc characterClass, unsigned char *buffer) const
int SCI_METHOD CodePage() const override
int SCI_METHOD GetLineIndentation(Sci_Position line) override
Sci_Position SCI_METHOD LineFromPosition(Sci_Position pos) const override
Document::CharacterExtracted CharacterBefore(Sci::Position position) const noexcept
void AnnotationClearAll()
void SetCaseFolder(CaseFolder *pcf_) noexcept
void DeleteMarkFromHandle(int markerHandle)
std::unique_ptr< LexInterface > pli
void EOLAnnotationSetStyle(Sci::Line line, int style)
void AnnotationSetStyles(Sci::Line line, const unsigned char *styles)
Sci::Position NextWordStart(Sci::Position pos, int delta) const
Find the start of the next word in either a forward (delta >= 0) or backwards direction (delta < 0).
Sci::Line LineFromPositionIndex(Sci::Position pos, int lineCharacterIndex) const noexcept
void Indent(bool forwards, Sci::Line lineBottom, Sci::Line lineTop)
Sci_Position SCI_METHOD LineStart(Sci_Position line) const override
Sci::Position FindText(Sci::Position minPos, Sci::Position maxPos, const char *search, int flags, Sci::Position *length)
Find text in document, supporting both forward and backward searches (just pass minPos > maxPos to do...
bool IsDBCSLeadByteNoExcept(char ch) const noexcept
Sci::Position ExtendStyleRange(Sci::Position pos, int delta, bool singleLine) noexcept
Sci::Position GetColumn(Sci::Position pos)
Sci::Line MarkerNext(Sci::Line lineStart, int mask) const noexcept
bool RemoveWatcher(DocWatcher *watcher, void *userData)
bool SCI_METHOD IsDBCSLeadByte(char ch) const override
void AllocateLineCharacterIndex(int lineCharacterIndex)
void NotifyModified(DocModification mh)
EncodingFamily CodePageFamily() const noexcept
int SCI_METHOD SetLineState(Sci_Position line, int state) override
Sci::Position CountCharacters(Sci::Position startPos, Sci::Position endPos) const noexcept
Sci::Position CountUTF16(Sci::Position startPos, Sci::Position endPos) const noexcept
double Duration(bool reset=false) noexcept
Return duration as floating point seconds.
Sci::Line firstChangeableLineBefore
Sci::Line firstChangeableLineAfter
virtual int LineEndTypesSupported()=0
virtual int Version() const =0
virtual void Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess)=0
virtual void Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess)=0
bool performingStyle
Prevent reentrance.
virtual int LineEndTypesSupported()
bool MultipleStyles(Sci::Line line) const noexcept
const char * Text(Sci::Line line) const noexcept
void SetText(Sci::Line line, const char *text)
int Length(Sci::Line line) const noexcept
void SetStyles(Sci::Line line, const unsigned char *styles)
int Style(Sci::Line line) const noexcept
void SetStyle(Sci::Line line, int style)
const unsigned char * Styles(Sci::Line line) const noexcept
int SetLevel(Sci::Line line, int level, Sci::Line lines)
int GetLevel(Sci::Line line) const noexcept
void DeleteMarkFromHandle(int markerHandle)
int AddMark(Sci::Line line, int markerNum, Sci::Line lines)
bool DeleteMark(Sci::Line line, int markerNum, bool all)
Sci::Line GetMaxLineState() const noexcept
int GetLineState(Sci::Line line)
int SetLineState(Sci::Line line, int state)
Sci::Position bopat[MAXTAG]
const char * Compile(const char *pattern, Sci::Position length, bool caseSensitive, bool posix) noexcept
void GrabMatches(const CharacterIndexer &ci)
int Execute(const CharacterIndexer &ci, Sci::Position lp, Sci::Position endp)
Sci::Position eopat[MAXTAG]
The range class represents a range of text in a document.
Interface class for regular expression searching.
static bool match(const unsigned char *line, const char *word)
Styling buffer using one element for each run rather than using a filled buffer.
constexpr int UTF8MaxBytes
std::unique_ptr< IDecorationList > DecorationListCreate(bool largeDocument)
constexpr int unicodeReplacementChar
constexpr bool UTF8IsAscii(int ch) noexcept
unsigned int UTF16FromUTF32Character(unsigned int val, wchar_t *tbuf) noexcept
constexpr bool IsLowerCase(int ch) noexcept
bool UTF8IsSeparator(const unsigned char *us) noexcept
constexpr bool IsSpaceOrTab(int ch) noexcept
RegexSearchBase * CreateRegexSearch(CharClassify *charClassTable)
Factory function for RegexSearchBase.
bool UTF8IsNEL(const unsigned char *us) noexcept
constexpr bool IsASCII(int ch) noexcept
constexpr int UTF8SeparatorLength
constexpr int UTF8NELLength
int UTF8Classify(const unsigned char *us, size_t len) noexcept
constexpr bool IsADigit(int ch) noexcept
int UnicodeFromUTF8(const unsigned char *us) noexcept
std::wstring WStringFromUTF8(const char *s, size_t len)
constexpr int LevelNumber(int level) noexcept
constexpr bool UTF8IsTrailByte(unsigned char ch) noexcept
const unsigned char UTF8BytesOfLead[256]
constexpr bool isspacechar(int ch) noexcept
Check if a character is a space.
constexpr bool IsUpperCase(int ch) noexcept
static GeanyIndentPrefs indentation
Used to pair watcher pointer with user data.