Patch #1716 2006-12-12 13:26

mcdave

Bugfix for bug: 006965
Download
1716-Bugfix_for_bug.patch (1.1 KB)
Category
Application::Bugfix
Status
Closed
Close date
2006-12-15 09:03
Assigned to
 
Index: src/sdk/cbeditor.cpp
===================================================================
--- src/sdk/cbeditor.cpp    (revision 3367)
+++ src/sdk/cbeditor.cpp    (working copy)
@@ -1409,6 +1409,28 @@
         }
         return true;
     }
+    //Lets check if the folded code is a sub-fold from a main fold?
+    //We can include this in the top check list but will propably hinder
+    //if you want to do some custom code for the inner folds instead of the main folds
+    if ((level & wxSCI_FOLDLEVELHEADERFLAG) &&
+        (wxSCI_FOLDLEVELBASE < (level & wxSCI_FOLDLEVELNUMBERMASK))) //Is it a sub-level
+    {
+        bool expand = false;
+        int maxLine = m_pControl->GetLastChild(line, -1);
+        if (fold == 2) // toggle
+            expand = !m_pControl->GetFoldExpanded(line);
+        else
+            expand = fold == 0;
+        m_pControl->SetFoldExpanded(line, expand);
+        if (maxLine > line)
+        {
+            if (expand)
+                m_pControl->ShowLines(line + 1, maxLine);
+            else
+                m_pControl->HideLines(line + 1, maxLine);
+        }
+        return true;
+    }
     return false;
 }
 
mcdave 2006-12-12 13:28

Scintilla is a weird yet VERY powerful editor base... it took a bit of time getting used too... but very nice...

killerbot 2006-12-15 09:03

got integrated into patch 1715, which has been applied " revision 3380