src/eric7/QScintilla/MiniEditor.py

branch
eric7
changeset 11148
15e30f0c76a8
parent 11090
f5f5f5803935
child 11177
f511038a0061
equal deleted inserted replaced
11147:dee6e106b4d3 11148:15e30f0c76a8
71 EncloseChars = { 71 EncloseChars = {
72 '"': '"', 72 '"': '"',
73 "'": "'", 73 "'": "'",
74 "(": "()", 74 "(": "()",
75 ")": "()", 75 ")": "()",
76 "{": "{}", # __IGNORE_WARNING_M613__ 76 "{": "{}", # __IGNORE_WARNING_M-613__
77 "}": "{}", # __IGNORE_WARNING_M613__ 77 "}": "{}", # __IGNORE_WARNING_M-613__
78 "[": "[]", 78 "[": "[]",
79 "]": "[]", 79 "]": "[]",
80 "<": "<>", 80 "<": "<>",
81 ">": "<>", 81 ">": "<>",
82 } 82 }
112 """ 112 """
113 if cmd == QsciScintilla.SCI_DELETEBACK: 113 if cmd == QsciScintilla.SCI_DELETEBACK:
114 line, index = self.getCursorPosition() 114 line, index = self.getCursorPosition()
115 text = self.text(line)[index - 1 : index + 1] 115 text = self.text(line)[index - 1 : index + 1]
116 matchingPairs = ["()", "[]", "{}", "<>", "''", '""'] 116 matchingPairs = ["()", "[]", "{}", "<>", "''", '""']
117 # __IGNORE_WARNING_M613__ 117 # __IGNORE_WARNING_M-613__
118 if text in matchingPairs: 118 if text in matchingPairs:
119 self.delete() 119 self.delete()
120 120
121 elif ( 121 elif (
122 cmd in (QsciScintilla.SCI_LOWERCASE, QsciScintilla.SCI_UPPERCASE) 122 cmd in (QsciScintilla.SCI_LOWERCASE, QsciScintilla.SCI_UPPERCASE)
3856 Private method to select a specific pygments lexer. 3856 Private method to select a specific pygments lexer.
3857 3857
3858 @return name of the selected pygments lexer 3858 @return name of the selected pygments lexer
3859 @rtype str 3859 @rtype str
3860 """ 3860 """
3861 from pygments.lexers import get_all_lexers # __IGNORE_WARNING_I102__ 3861 from pygments.lexers import get_all_lexers # __IGNORE_WARNING_I-102__
3862 3862
3863 lexerList = sorted(lex[0] for lex in get_all_lexers()) 3863 lexerList = sorted(lex[0] for lex in get_all_lexers())
3864 try: 3864 try:
3865 lexerSel = lexerList.index( 3865 lexerSel = lexerList.index(
3866 self.getLanguage(normalized=False, forPygments=True) 3866 self.getLanguage(normalized=False, forPygments=True)

eric ide

mercurial