aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <unknown>2010-07-27 21:20:25 +1000
committernyamatongwe <unknown>2010-07-27 21:20:25 +1000
commit7227741b09e48d8a65b03bad1a8c245e47baa224 (patch)
treed1c669d2fcaa77a52c34823a6bd4407da57650fa /src
parent841ff8ffa220182ffda87eb6df9652f23f187cf6 (diff)
downloadscintilla-mirror-7227741b09e48d8a65b03bad1a8c245e47baa224.tar.gz
Fix problems with line state and fold level by duplicating value rather than inserting default.
Diffstat (limited to 'src')
-rw-r--r--src/PerLine.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/PerLine.cxx b/src/PerLine.cxx
index 21d02af72..59d7882cd 100644
--- a/src/PerLine.cxx
+++ b/src/PerLine.cxx
@@ -245,10 +245,7 @@ void LineLevels::Init() {
void LineLevels::InsertLine(int line) {
if (levels.Length()) {
- int level = SC_FOLDLEVELBASE;
- if ((line > 0) && (line < levels.Length())) {
- level = levels[line-1] & ~SC_FOLDLEVELWHITEFLAG;
- }
+ int level = (line < levels.Length()) ? levels[line] : SC_FOLDLEVELBASE;
levels.InsertValue(line, 1, level);
}
}
@@ -306,7 +303,8 @@ void LineState::Init() {
void LineState::InsertLine(int line) {
if (lineStates.Length()) {
lineStates.EnsureLength(line);
- lineStates.Insert(line, 0);
+ int val = (line < lineStates.Length()) ? lineStates[line] : 0;
+ lineStates.Insert(line, val);
}
}