Preferences/__init__.py

branch
5_5_x
changeset 3732
88b9be051ce9
parent 3726
6b0daa6508f9
child 3847
4a946734fd27
--- a/Preferences/__init__.py	Thu Jul 24 22:34:05 2014 +0200
+++ b/Preferences/__init__.py	Sat Jul 26 12:05:01 2014 +0200
@@ -29,7 +29,7 @@
 from PyQt4.QtGui import QColor, QFont, QInputDialog, QPalette, QApplication
 from PyQt4.QtNetwork import QNetworkRequest
 from PyQt4.QtWebKit import QWebSettings
-from PyQt4.Qsci import QsciScintilla
+from PyQt4.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,
@@ -1650,6 +1650,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