7778 matchingPairs = ["()", "[]", "{}", "<>", "''", '""'] |
7778 matchingPairs = ["()", "[]", "{}", "<>", "''", '""'] |
7779 # __IGNORE_WARNING_M613__ |
7779 # __IGNORE_WARNING_M613__ |
7780 if text in matchingPairs: |
7780 if text in matchingPairs: |
7781 self.delete() |
7781 self.delete() |
7782 |
7782 |
|
7783 elif ( |
|
7784 cmd in (QsciScintilla.SCI_LOWERCASE, QsciScintilla.SCI_UPPERCASE) |
|
7785 and self.hasSelectedText() |
|
7786 ): |
|
7787 startLine, startIndex, endLine, _ = self.getSelection() |
|
7788 selectedText = self.selectedText() |
|
7789 replacementText = ( |
|
7790 selectedText.upper() |
|
7791 if cmd == QsciScintilla.SCI_UPPERCASE |
|
7792 else selectedText.lower() |
|
7793 ) |
|
7794 self.replaceSelectedText(replacementText) |
|
7795 self.setSelection( |
|
7796 startLine, startIndex, endLine, len(replacementText.splitlines()[-1]) |
|
7797 ) |
|
7798 return |
|
7799 |
7783 super().editorCommand(cmd) |
7800 super().editorCommand(cmd) |
7784 |
7801 |
7785 def __applyTemplate(self, templateName, language): |
7802 def __applyTemplate(self, templateName, language): |
7786 """ |
7803 """ |
7787 Private method to apply a template by name. |
7804 Private method to apply a template by name. |