Preferences/__init__.py

changeset 3730
dccee91e9d8a
parent 3691
c473d6347610
child 3845
949682ceda54
--- a/Preferences/__init__.py	Thu Jul 24 22:34:05 2014 +0200
+++ b/Preferences/__init__.py	Sat Jul 26 12:05:01 2014 +0200
@@ -30,7 +30,7 @@
 from PyQt5.QtWidgets import QInputDialog, QApplication
 from PyQt5.QtNetwork import QNetworkRequest
 from PyQt5.QtWebKit import QWebSettings
-from PyQt5.Qsci import QsciScintilla
+from PyQt5.Qsci import QsciScintilla, QsciLexerPython
 
 from E5Gui import E5FileDialog
 
@@ -401,7 +401,7 @@
         "PropertiesInitialSpaces": True,
         
         # Python specifics
-        "PythonBadIndentation": True,
+        "PythonBadIndentation": QsciLexerPython.Inconsistent,
         "PythonFoldComment": True,
         "PythonFoldString": True,
         "PythonAutoIndent": True,
@@ -1657,6 +1657,14 @@
                  "PreviewQssFileNameExtensions"]:
         return toList(prefClass.settings.value(
             "Editor/" + key, prefClass.editorDefaults[key]))
+    elif key in ["PythonBadIndentation"]:
+        value = prefClass.settings.value(
+            "Editor/" + key, prefClass.editorDefaults[key])
+        if value in ["true", "True"]:
+            value = 1
+        elif value in ["false", "False"]:
+            value = 0
+        return QsciLexerPython.IndentationWarning(int(value))
     else:
         return toBool(prefClass.settings.value(
             "Editor/" + key, prefClass.editorDefaults[key]))

eric ide

mercurial