128 Preferences.getEditor("PythonBadIndentation")) |
129 Preferences.getEditor("PythonBadIndentation")) |
129 self.setFoldComments(Preferences.getEditor("PythonFoldComment")) |
130 self.setFoldComments(Preferences.getEditor("PythonFoldComment")) |
130 self.setFoldQuotes(Preferences.getEditor("PythonFoldString")) |
131 self.setFoldQuotes(Preferences.getEditor("PythonFoldString")) |
131 if not Preferences.getEditor("PythonAutoIndent"): |
132 if not Preferences.getEditor("PythonAutoIndent"): |
132 self.setAutoIndentStyle(QsciScintilla.AiMaintain) |
133 self.setAutoIndentStyle(QsciScintilla.AiMaintain) |
133 try: |
134 with contextlib.suppress(AttributeError): |
134 self.setV2UnicodeAllowed( |
135 self.setV2UnicodeAllowed( |
135 Preferences.getEditor("PythonAllowV2Unicode")) |
136 Preferences.getEditor("PythonAllowV2Unicode")) |
136 self.setV3BinaryOctalAllowed( |
137 self.setV3BinaryOctalAllowed( |
137 Preferences.getEditor("PythonAllowV3Binary")) |
138 Preferences.getEditor("PythonAllowV3Binary")) |
138 self.setV3BytesAllowed(Preferences.getEditor("PythonAllowV3Bytes")) |
139 self.setV3BytesAllowed(Preferences.getEditor("PythonAllowV3Bytes")) |
139 except AttributeError: |
140 with contextlib.suppress(AttributeError): |
140 pass |
|
141 try: |
|
142 self.setFoldQuotes(Preferences.getEditor("PythonFoldQuotes")) |
141 self.setFoldQuotes(Preferences.getEditor("PythonFoldQuotes")) |
143 self.setStringsOverNewlineAllowed( |
142 self.setStringsOverNewlineAllowed( |
144 Preferences.getEditor("PythonStringsOverNewLineAllowed")) |
143 Preferences.getEditor("PythonStringsOverNewLineAllowed")) |
145 except AttributeError: |
144 with contextlib.suppress(AttributeError): |
146 pass |
|
147 try: |
|
148 self.setHighlightSubidentifiers( |
145 self.setHighlightSubidentifiers( |
149 Preferences.getEditor("PythonHighlightSubidentifier")) |
146 Preferences.getEditor("PythonHighlightSubidentifier")) |
150 except AttributeError: |
147 |
151 pass |
|
152 |
|
153 def getIndentationDifference(self, line, editor): |
148 def getIndentationDifference(self, line, editor): |
154 """ |
149 """ |
155 Public method to determine the difference for the new indentation. |
150 Public method to determine the difference for the new indentation. |
156 |
151 |
157 @param line line to perform the calculation for (integer) |
152 @param line line to perform the calculation for (integer) |