diff options
author | Neil <nyamatongwe@gmail.com> | 2018-07-10 15:06:50 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2018-07-10 15:06:50 +1000 |
commit | 56e20ea0283d8018dee48d736ba9dfef3c84dc3f (patch) | |
tree | 21bdb500dfc092fadecb123b87e9799a2c46f6a9 /src/CellBuffer.h | |
parent | d27cbe587930d13d3f1802b271d0d13e7e3c6e38 (diff) | |
download | scintilla-mirror-56e20ea0283d8018dee48d736ba9dfef3c84dc3f.tar.gz |
Optional indexing of line starts in UTF-8 documents by UTF-32 code points and
UTF-16 code units added.
Diffstat (limited to 'src/CellBuffer.h')
-rw-r--r-- | src/CellBuffer.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/CellBuffer.h b/src/CellBuffer.h index f360b2a23..b9f2406f1 100644 --- a/src/CellBuffer.h +++ b/src/CellBuffer.h @@ -113,6 +113,7 @@ private: SplitVector<char> substance; SplitVector<char> style; bool readOnly; + bool utf8Substance; int utf8LineEnds; bool collectingUndo; @@ -121,7 +122,9 @@ private: std::unique_ptr<ILineVector> plv; bool UTF8LineEndOverlaps(Sci::Position position) const; + bool UTF8IsCharacterBoundary(Sci::Position position) const; void ResetLineEnds(); + void RecalculateIndexLineStarts(Sci::Line lineFirst, Sci::Line lineLast); /// Actions without undo void BasicInsertString(Sci::Position position, const char *s, Sci::Position insertLength); void BasicDeleteChars(Sci::Position position, Sci::Position deleteLength); @@ -148,13 +151,19 @@ public: Sci::Position Length() const noexcept; void Allocate(Sci::Position newSize); + void SetUTF8Substance(bool utf8Substance_); int GetLineEndTypes() const { return utf8LineEnds; } void SetLineEndTypes(int utf8LineEnds_); bool ContainsLineEnd(const char *s, Sci::Position length) const; void SetPerLine(PerLine *pl); + int LineCharacterIndex() const noexcept; + void AllocateLineCharacterIndex(int lineCharacterIndex); + void ReleaseLineCharacterIndex(int lineCharacterIndex); Sci::Line Lines() const noexcept; Sci::Position LineStart(Sci::Line line) const noexcept; + Sci::Position IndexLineStart(Sci::Line line, int lineCharacterIndex) const noexcept; Sci::Line LineFromPosition(Sci::Position pos) const noexcept; + Sci::Line LineFromPositionIndex(Sci::Position pos, int lineCharacterIndex) const noexcept; void InsertLine(Sci::Line line, Sci::Position position, bool lineStart); void RemoveLine(Sci::Line line); const char *InsertString(Sci::Position position, const char *s, Sci::Position insertLength, bool &startSequence); |