aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ContractionState.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/ContractionState.cxx')
-rw-r--r--src/ContractionState.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/ContractionState.cxx b/src/ContractionState.cxx
index 565f9e141..8b5821470 100644
--- a/src/ContractionState.cxx
+++ b/src/ContractionState.cxx
@@ -210,16 +210,24 @@ Sci::Line ContractionState<LINE>::DocFromDisplay(Sci::Line lineDisplay) const {
template <typename LINE>
void ContractionState<LINE>::InsertLines(Sci::Line lineDoc, Sci::Line lineCount) {
- for (Sci::Line l = 0; l < lineCount; l++) {
- InsertLine(lineDoc + l);
+ if (OneToOne()) {
+ linesInDocument += static_cast<LINE>(lineCount);
+ } else {
+ for (Sci::Line l = 0; l < lineCount; l++) {
+ InsertLine(lineDoc + l);
+ }
}
Check();
}
template <typename LINE>
void ContractionState<LINE>::DeleteLines(Sci::Line lineDoc, Sci::Line lineCount) {
- for (Sci::Line l = 0; l < lineCount; l++) {
- DeleteLine(lineDoc);
+ if (OneToOne()) {
+ linesInDocument -= static_cast<LINE>(lineCount);
+ } else {
+ for (Sci::Line l = 0; l < lineCount; l++) {
+ DeleteLine(lineDoc);
+ }
}
Check();
}