174 self.editor.insert('\'') |
174 self.editor.insert('\'') |
175 |
175 |
176 # colon |
176 # colon |
177 # skip colon, dedent to if for else: |
177 # skip colon, dedent to if for else: |
178 elif char == ':': |
178 elif char == ':': |
179 if char == self.editor.text(line)[col]: |
179 text = self.editor.text(line) |
|
180 if col < len(text) and char == txt[col]: |
180 if self.__colonDetection: |
181 if self.__colonDetection: |
181 self.editor.setSelection(line, col, line, col + 1) |
182 self.editor.setSelection(line, col, line, col + 1) |
182 self.editor.removeSelectedText() |
183 self.editor.removeSelectedText() |
183 else: |
184 else: |
184 txt = self.editor.text(line)[:col] |
185 txt = text[:col] |
185 if self.__dedentElse and self.__elseRX.exactMatch(txt): |
186 if self.__dedentElse and self.__elseRX.exactMatch(txt): |
186 self.__dedentElseToIfWhileForTry() |
187 self.__dedentElseToIfWhileForTry() |
187 elif self.__dedentExcept and self.__exceptcRX.exactMatch(txt): |
188 elif self.__dedentExcept and self.__exceptcRX.exactMatch(txt): |
188 self.__dedentExceptToTry(True) |
189 self.__dedentExceptToTry(True) |
189 elif self.__dedentExcept and self.__finallyRX.exactMatch(txt): |
190 elif self.__dedentExcept and self.__finallyRX.exactMatch(txt): |