From 7227741b09e48d8a65b03bad1a8c245e47baa224 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 27 Jul 2010 21:20:25 +1000 Subject: Fix problems with line state and fold level by duplicating value rather than inserting default. --- src/PerLine.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src') 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); } } -- cgit v1.2.3