109 text = self.text(line)[index - 1 : index + 1] |
109 text = self.text(line)[index - 1 : index + 1] |
110 matchingPairs = ["()", "[]", "{}", "<>", "''", '""'] |
110 matchingPairs = ["()", "[]", "{}", "<>", "''", '""'] |
111 # __IGNORE_WARNING_M613__ |
111 # __IGNORE_WARNING_M613__ |
112 if text in matchingPairs: |
112 if text in matchingPairs: |
113 self.delete() |
113 self.delete() |
|
114 |
|
115 elif ( |
|
116 cmd in (QsciScintilla.SCI_LOWERCASE, QsciScintilla.SCI_UPPERCASE) |
|
117 and self.hasSelectedText() |
|
118 ): |
|
119 startLine, startIndex, endLine, _ = self.getSelection() |
|
120 selectedText = self.selectedText() |
|
121 replacementText = ( |
|
122 selectedText.upper() |
|
123 if cmd == QsciScintilla.SCI_UPPERCASE |
|
124 else selectedText.lower() |
|
125 ) |
|
126 self.replaceSelectedText(replacementText) |
|
127 self.setSelection( |
|
128 startLine, startIndex, endLine, len(replacementText.splitlines()[-1]) |
|
129 ) |
|
130 return |
114 |
131 |
115 super().editorCommand(cmd) |
132 super().editorCommand(cmd) |
116 |
133 |
117 def keyPressEvent(self, ev): |
134 def keyPressEvent(self, ev): |
118 """ |
135 """ |