eric6/QScintilla/Lexers/LexerTCL.py

changeset 8243
cc717c2ae956
parent 7923
91e843545d9a
equal deleted inserted replaced
8242:aa713ac50c0d 8243:cc717c2ae956
4 # 4 #
5 5
6 """ 6 """
7 Module implementing a TCL/Tk lexer with some additional methods. 7 Module implementing a TCL/Tk lexer with some additional methods.
8 """ 8 """
9
10 import contextlib
9 11
10 from PyQt5.Qsci import QsciLexerTCL 12 from PyQt5.Qsci import QsciLexerTCL
11 13
12 from .Lexer import Lexer 14 from .Lexer import Lexer
13 15
43 45
44 def initProperties(self): 46 def initProperties(self):
45 """ 47 """
46 Public slot to initialize the properties. 48 Public slot to initialize the properties.
47 """ 49 """
48 try: 50 with contextlib.suppress(AttributeError):
49 self.setFoldCompact(Preferences.getEditor("AllFoldCompact")) 51 self.setFoldCompact(Preferences.getEditor("AllFoldCompact"))
50 except AttributeError: 52 with contextlib.suppress(AttributeError):
51 pass
52 try:
53 self.setFoldComments(Preferences.getEditor("TclFoldComment")) 53 self.setFoldComments(Preferences.getEditor("TclFoldComment"))
54 except AttributeError:
55 pass
56 54
57 def isCommentStyle(self, style): 55 def isCommentStyle(self, style):
58 """ 56 """
59 Public method to check, if a style is a comment style. 57 Public method to check, if a style is a comment style.
60 58

eric ide

mercurial