|
@@ -75,7 +75,7 @@ class Highlighter(QtGui.QSyntaxHighlighter):
|
|
|
keyword = QtGui.QTextCharFormat()
|
|
|
keyword.setForeground(QtCore.Qt.darkBlue)
|
|
|
keyword.setFontWeight(QtGui.QFont.Bold)
|
|
|
- keywords = QtCore.QStringList(kw)
|
|
|
+ keywords = kw
|
|
|
for word in keywords:
|
|
|
pattern = QtCore.QRegExp("\\b" + word + "\\b")
|
|
|
self.highlightingRules.append((pattern, keyword))
|
|
@@ -98,7 +98,7 @@ class Highlighter(QtGui.QSyntaxHighlighter):
|
|
|
pref_format = self.format(index)
|
|
|
pref_format.merge(format)
|
|
|
self.setFormat(index, length, pref_format)
|
|
|
- index = text.indexOf(pattern, index + length)
|
|
|
+ index = pattern.indexIn(text, index + length)
|
|
|
|
|
|
self.setCurrentBlockState(0)
|
|
|
|