eric6/QScintilla/EditorOutlineModel.py

changeset 7757
1f9f35f9be6d
parent 7697
c981a807aab1
child 7923
91e843545d9a
--- a/eric6/QScintilla/EditorOutlineModel.py	Sun Oct 04 18:53:35 2020 +0200
+++ b/eric6/QScintilla/EditorOutlineModel.py	Mon Oct 05 19:11:15 2020 +0200
@@ -17,6 +17,8 @@
     BrowserClassAttributesItem, BrowserMethodItem
 )
 
+import Preferences
+
 
 class EditorOutlineModel(BrowserModel):
     """
@@ -90,9 +92,13 @@
                 parentItem = self.rootItem
                 
                 if repopulate:
-                    self.beginInsertRows(
-                        QModelIndex(),
-                        0, len(keys) - 1)
+                    last = len(keys) - 1
+                    if (
+                        "@@Coding@@" in keys and
+                        not Preferences.getEditor("SourceOutlineShowCoding")
+                    ):
+                        last -= 1
+                    self.beginInsertRows(QModelIndex(), 0, last)
                 
                 for key in keys:
                     if key.startswith("@@"):
@@ -106,7 +112,10 @@
                             self._addItem(node, parentItem)
                     except AttributeError:
                         pass
-                if "@@Coding@@" in keys:
+                if (
+                    "@@Coding@@" in keys and
+                    Preferences.getEditor("SourceOutlineShowCoding")
+                ):
                     node = BrowserCodingItem(
                         parentItem,
                         QCoreApplication.translate(

eric ide

mercurial