Preferences/PreferencesLexer.py

branch
sub_styles
changeset 6858
9d962e654978
parent 6855
4d80c8cc99a1
child 6861
20899dc18e59
equal deleted inserted replaced
6857:59f6251587fa 6858:9d962e654978
95 if self.__lex is None: 95 if self.__lex is None:
96 raise PreferencesLexerLanguageError(language) 96 raise PreferencesLexerLanguageError(language)
97 97
98 # read the last stored values from preferences file 98 # read the last stored values from preferences file
99 self.__lex.readSettings(Preferences.Prefs.settings, "Scintilla") 99 self.__lex.readSettings(Preferences.Prefs.settings, "Scintilla")
100 if self.__lex.hasSubStyles(): 100 if self.__lex.hasSubstyles():
101 self.__lex.loadSubstyles() 101 self.__lex.loadSubstyles()
102 102
103 def writeSettings(self): 103 def writeSettings(self):
104 """ 104 """
105 Public method to write the lexer settings. 105 Public method to write the lexer settings.
106 """ 106 """
107 self.__lex.writeSettings(Preferences.Prefs.settings, "Scintilla") 107 self.__lex.writeSettings(Preferences.Prefs.settings, "Scintilla")
108 if self.__lex.hasSubStyles(): 108 if self.__lex.hasSubstyles():
109 self.__lex.writeSubStyles() 109 self.__lex.writeSubstyles()
110 110
111 def getStyles(self): 111 def getStyles(self):
112 """ 112 """
113 Public method to get a list of all supported styles. 113 Public method to get a list of all supported styles.
114 114
119 119
120 for i in range(QsciScintillaBase.STYLE_MAX): 120 for i in range(QsciScintillaBase.STYLE_MAX):
121 desc = self.__lex.description(i) 121 desc = self.__lex.description(i)
122 if desc: 122 if desc:
123 styles.append((desc, i, -1)) 123 styles.append((desc, i, -1))
124 if self.__lex.hasSubStyles(): 124 if self.__lex.hasSubstyles():
125 for baseStyle in self.__lex.getBaseStyles(): 125 for baseStyle in self.__lex.getBaseStyles():
126 for subStyle in range(self.__lex.substylesCount(baseStyle)): 126 for subStyle in range(self.__lex.substylesCount(baseStyle)):
127 desc = self.__lex.substyleDescription(baseStyle, subStyle) 127 desc = self.__lex.substyleDescription(baseStyle, subStyle)
128 styles.append((desc, baseStyle, subStyle)) 128 styles.append((desc, baseStyle, subStyle))
129 129
231 if substyle >= 0: 231 if substyle >= 0:
232 self.__lex.setSubstylePaper(c, style, substyle) 232 self.__lex.setSubstylePaper(c, style, substyle)
233 else: 233 else:
234 self.__lex.setPaper(c, style) 234 self.__lex.setPaper(c, style)
235 235
236 def defaulEolFill(self, style, substyle=-1): 236 def defaultEolFill(self, style, substyle=-1):
237 """ 237 """
238 Public method to get the default eolFill flag for a style. 238 Public method to get the default eolFill flag for a style.
239 239
240 @param style style number 240 @param style style number
241 @type int 241 @type int

eric ide

mercurial