src/eric7/QScintilla/TypingCompleters/CompleterPython.py

branch
eric7
changeset 10069
435cc5875135
parent 9995
00eb2b418f8e
child 10115
8ca3f08c5ac8
equal deleted inserted replaced
10068:7febcdccb2a1 10069:435cc5875135
147 self.editor.setCursorPosition(line, col + 7) 147 self.editor.setCursorPosition(line, col + 7)
148 self.editor.endUndoAction() 148 self.editor.endUndoAction()
149 elif self.__dedentElse and self.__elifRX.fullmatch(txt): 149 elif self.__dedentElse and self.__elifRX.fullmatch(txt):
150 self.__dedentToIf() 150 self.__dedentToIf()
151 elif self.__dedentExcept and self.__exceptRX.fullmatch(txt): 151 elif self.__dedentExcept and self.__exceptRX.fullmatch(txt):
152 self.__dedentExceptToTry(False) 152 self.__dedentExceptToTry()
153 elif self.__dedentDef and self.__defOnlyRX.fullmatch(txt): 153 elif self.__dedentDef and self.__defOnlyRX.fullmatch(txt):
154 self.__dedentDefStatement() 154 self.__dedentDefStatement()
155 155
156 # comma 156 # comma
157 # insert blank 157 # insert blank
190 else: 190 else:
191 txt = text[:col] 191 txt = text[:col]
192 if self.__dedentElse and self.__elseRX.fullmatch(txt): 192 if self.__dedentElse and self.__elseRX.fullmatch(txt):
193 self.__dedentElseToIfWhileForTry() 193 self.__dedentElseToIfWhileForTry()
194 elif self.__dedentExcept and self.__exceptcRX.fullmatch(txt): 194 elif self.__dedentExcept and self.__exceptcRX.fullmatch(txt):
195 self.__dedentExceptToTry(True) 195 self.__dedentExceptToTry()
196 elif self.__dedentExcept and self.__finallyRX.fullmatch(txt): 196 elif self.__dedentExcept and self.__finallyRX.fullmatch(txt):
197 self.__dedentFinallyToTry() 197 self.__dedentFinallyToTry()
198 198
199 # new line 199 # new line
200 # indent to opening brace 200 # indent to opening brace
276 self.editor.cancelList() 276 self.editor.cancelList()
277 self.editor.setIndentation(line, edInd) 277 self.editor.setIndentation(line, edInd)
278 break 278 break
279 ifLine -= 1 279 ifLine -= 1
280 280
281 def __dedentExceptToTry(self, hasColon): 281 def __dedentExceptToTry(self):
282 """ 282 """
283 Private method to dedent the line of the except statement to the last 283 Private method to dedent the line of the except statement to the last
284 try statement with less (or equal) indentation. 284 try statement with less (or equal) indentation.
285
286 @param hasColon flag indicating the except type (boolean)
287 """ 285 """
288 line, col = self.editor.getCursorPosition() 286 line, col = self.editor.getCursorPosition()
289 indentation = self.editor.indentation(line) 287 indentation = self.editor.indentation(line)
290 tryLine = line - 1 288 tryLine = line - 1
291 while tryLine >= 0: 289 while tryLine >= 0:

eric ide

mercurial