eric6/QScintilla/Editor.py

changeset 8165
61ca9619decb
parent 8158
16a34a0167ba
child 8169
139bd30c52c2
equal deleted inserted replaced
8164:c8b88e73b56f 8165:61ca9619decb
4712 self.setPaper(Preferences.getEditorColour("EditAreaBackground")) 4712 self.setPaper(Preferences.getEditorColour("EditAreaBackground"))
4713 4713
4714 self.setVirtualSpaceOptions( 4714 self.setVirtualSpaceOptions(
4715 Preferences.getEditor("VirtualSpaceOptions")) 4715 Preferences.getEditor("VirtualSpaceOptions"))
4716 4716
4717 # to avoid errors due to line endings by pasting
4718 self.SendScintilla(QsciScintilla.SCI_SETPASTECONVERTENDINGS, True)
4719
4717 self.__markerMap.setEnabled(True) 4720 self.__markerMap.setEnabled(True)
4718 4721
4719 def __setEolMode(self): 4722 def __setEolMode(self):
4720 """ 4723 """
4721 Private method to configure the eol mode of the editor. 4724 Private method to configure the eol mode of the editor.
7720 self.showUserList( 7723 self.showUserList(
7721 TemplateCompletionListID, 7724 TemplateCompletionListID,
7722 ["{0}?{1:d}".format(t, self.TemplateImageID) 7725 ["{0}?{1:d}".format(t, self.TemplateImageID)
7723 for t in templateNames]) 7726 for t in templateNames])
7724 return 7727 return
7728
7729 elif cmd == QsciScintilla.SCI_DELETEBACK:
7730 line, index = self.getCursorPosition()
7731 text = self.text(line)[index - 1:index + 1]
7732 matchingPairs = ['()', '[]', '{}', '<>', "''", '""']
7733 if text in matchingPairs:
7734 self.delete()
7725 7735
7726 super(Editor, self).editorCommand(cmd) 7736 super(Editor, self).editorCommand(cmd)
7727 7737
7728 def __applyTemplate(self, templateName, language): 7738 def __applyTemplate(self, templateName, language):
7729 """ 7739 """

eric ide

mercurial