From 92676970616a5163636329e49c4cc825e46d6c7f Mon Sep 17 00:00:00 2001 From: mitchell Date: Sat, 5 May 2018 23:10:51 -0400 Subject: Backport: Add SC_DOCUMENTOPTION_TEXT_LARGE option for documents larger than 2 GigaBytes. This option is provisional and experimental. Backport of changesets 6696:9729ff36c5b1 and 6723:cffe824ab55e. Also added '#include ' to top of src/RESearch.cxx to fix 32-bit build error. --- src/Document.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/Document.cxx') diff --git a/src/Document.cxx b/src/Document.cxx index 34238af35..b1128b82b 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -86,7 +86,7 @@ int LexInterface::LineEndTypesSupported() { } Document::Document(int options) : - cb((options & SC_DOCUMENTOPTION_STYLES_NONE) == 0) { + cb((options & SC_DOCUMENTOPTION_STYLES_NONE) == 0, (options & SC_DOCUMENTOPTION_TEXT_LARGE) != 0) { refCount = 0; #ifdef _WIN32 eolMode = SC_EOL_CRLF; @@ -117,7 +117,7 @@ Document::Document(int options) : perLineData[ldMargin].reset(new LineAnnotation()); perLineData[ldAnnotation].reset(new LineAnnotation()); - decorations = DecorationListCreate(false); + decorations = DecorationListCreate(IsLarge()); cb.SetPerLine(this); } @@ -556,7 +556,7 @@ void Document::GetHighlightDelimiters(HighlightDelimiter &highlightDelimiter, Sc } Sci::Position Document::ClampPositionIntoDocument(Sci::Position pos) const { - return Sci::clamp(pos, 0, static_cast(Length())); + return Sci::clamp(pos, static_cast(0), static_cast(Length())); } bool Document::IsCrLf(Sci::Position pos) const { @@ -1524,6 +1524,11 @@ void Document::ConvertLineEnds(int eolModeSet) { } +int Document::Options() const { + return (IsLarge() ? SC_DOCUMENTOPTION_TEXT_LARGE : 0) | + (cb.HasStyles() ? 0 : SC_DOCUMENTOPTION_STYLES_NONE); +} + bool Document::IsWhiteLine(Sci::Line line) const { Sci::Position currentChar = static_cast(LineStart(line)); const Sci::Position endLine = static_cast(LineEnd(line)); -- cgit v1.2.3