aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Document.cxx
diff options
context:
space:
mode:
authormitchell <unknown>2018-05-05 23:10:51 -0400
committermitchell <unknown>2018-05-05 23:10:51 -0400
commit92676970616a5163636329e49c4cc825e46d6c7f (patch)
tree9e2cc612919e2bc1ee50a31dc0fd8bb7652d94d7 /src/Document.cxx
parent74d9510a055d6b9aa9d7679522f255db62de76d0 (diff)
downloadscintilla-mirror-92676970616a5163636329e49c4cc825e46d6c7f.tar.gz
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 <cstddef>' to top of src/RESearch.cxx to fix 32-bit build error.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r--src/Document.cxx11
1 files changed, 8 insertions, 3 deletions
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<Sci::Position>(Length()));
+ return Sci::clamp(pos, static_cast<Sci::Position>(0), static_cast<Sci::Position>(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<Sci::Position>(LineStart(line));
const Sci::Position endLine = static_cast<Sci::Position>(LineEnd(line));