diff options
Diffstat (limited to 'src/ContractionState.cxx')
-rw-r--r-- | src/ContractionState.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ContractionState.cxx b/src/ContractionState.cxx index 6f41461eb..816d06aae 100644 --- a/src/ContractionState.cxx +++ b/src/ContractionState.cxx @@ -108,8 +108,8 @@ void ContractionState::InsertLines(int lineDoc, int lineCount) { return; } //Platform::DebugPrintf("InsertLine[%d] = %d\n", lineDoc); - if ((linesInDoc + 2) >= size) { - Grow(size + growSize); + if ((linesInDoc + lineCount + 2) >= size) { + Grow(linesInDoc + lineCount + growSize); } linesInDoc += lineCount; linesInDisplay += lineCount; @@ -155,7 +155,7 @@ bool ContractionState::GetVisible(int lineDoc) const { bool ContractionState::SetVisible(int lineDocStart, int lineDocEnd, bool visible) { if (size == 0) { - Grow(lineDocEnd + growSize); + Grow(linesInDoc + growSize); } // TODO: modify docLine members to mirror displayLine int delta = 0; @@ -191,7 +191,7 @@ bool ContractionState::GetExpanded(int lineDoc) const { bool ContractionState::SetExpanded(int lineDoc, bool expanded) { if (size == 0) { - Grow(lineDoc + growSize); + Grow(linesInDoc + growSize); } if ((lineDoc >= 0) && (lineDoc < linesInDoc)) { if (lines[lineDoc].expanded != expanded) { |