src/eric7/QScintilla/Editor.py

branch
eric7
changeset 9333
b0541ec21e51
parent 9331
1f8780a59a0d
child 9371
1da8bc75946f
child 9405
99e65bd24e7d
equal deleted inserted replaced
9332:2e0a16d95083 9333:b0541ec21e51
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.

eric ide

mercurial