r14970 by cbradney - Highlighter patch from #8651

scribus-commit scribus-commit at lists.scribus.net
Wed Apr 14 22:30:22 CEST 2010


Revision: 14970
Author: cbradney
Date: 2010-04-14T20:28:08.549988Z
Commit message: Highlighter patch from #8651

Changeset: 
M  /trunk/Scribus/scribus/plugins/scripter/python/sceditor/highlighter.py

Diffs:
Index: scribus/plugins/scripter/python/sceditor/highlighter.py
===================================================================
--- scribus/plugins/scripter/python/sceditor/highlighter.py	(revision 14969)
+++ scribus/plugins/scripter/python/sceditor/highlighter.py	(revision 14970)
@@ -63,7 +63,7 @@
         
         startIndex = 0
         if self.previousBlockState() != 1:
-            startIndex = text.indexOf(self.multiLineStringBegin)
+            startIndex = self.multiLineStringBegin.indexIn(text)
         
         if startIndex > -1:
             self.highlightRules(text, 0, startIndex)
@@ -72,7 +72,7 @@
         
         while startIndex >= 0:
         
-            endIndex = text.indexOf(self.multiLineStringEnd,
+            endIndex = self.multiLineStringEnd.indexIn(text,
                 startIndex + len(self.multiLineStringBegin.pattern()))
             if endIndex == -1:
                 self.setCurrentBlockState(1)
@@ -83,18 +83,18 @@
                 self.highlightRules(text, endIndex, len(text))
             
             self.setFormat(startIndex, commentLength, self.multiLineStringFormat)
-            startIndex = text.indexOf(self.multiLineStringBegin,
+            startIndex = self.multiLineStringBegin.indexIn(text,
                                       startIndex + commentLength)
     
     def highlightRules(self, text, start, finish):
     
         for expression, format in self.rules:
         
-            index = text.indexOf(expression, start)
+            index = expression.indexIn(text, start)
             while index >= start and index < finish:
                 length = expression.matchedLength()
                 self.setFormat(index, min(length, finish - index), format)
-                index = text.indexOf(expression, index + length)
+                index = expression.indexIn(text, index + length)
     
     def updateFonts(self, font):
     




More information about the scribus-commit mailing list