diff options
Diffstat (limited to 'src/CellBuffer.cxx')
| -rw-r--r-- | src/CellBuffer.cxx | 11 | 
1 files changed, 10 insertions, 1 deletions
| diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx index 9576e917d..0f33d48c4 100644 --- a/src/CellBuffer.cxx +++ b/src/CellBuffer.cxx @@ -191,11 +191,20 @@ void LineVector::InsertValue(int pos, int value) {  		}  	}  	lines++; -	for (int i = lines + 1; i > pos; i--) { +	for (int i = lines; i > pos; i--) {  		linesData[i] = linesData[i - 1];  	}  	linesData[pos].startPosition = value;  	linesData[pos].handleSet = 0; +	if (levels) { +		for (int j = lines; j > pos; j--) { +			levels[j] = levels[j - 1]; +		} +		if (pos == (lines-1))	// Last line will not be a folder +			levels[pos] = SC_FOLDLEVELBASE; +		else +			levels[pos] = SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG; +	}  }  void LineVector::SetValue(int pos, int value) { | 
