diff options
author | nyamatongwe <devnull@localhost> | 2010-07-27 21:20:25 +1000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2010-07-27 21:20:25 +1000 |
commit | 8e7d3de38d47102c129d7a40abef3a81b5af5a29 (patch) | |
tree | f625d24c8a2cfabe46de3b8ee82265eb37f60ff6 | |
parent | 0b81d3c16736d1d03216f2a2a75b920c13b1f6aa (diff) | |
download | scintilla-mirror-8e7d3de38d47102c129d7a40abef3a81b5af5a29.tar.gz |
Fix problems with line state and fold level by duplicating value rather than inserting default.
-rw-r--r-- | src/PerLine.cxx | 8 |
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); } } |