Fix bug with multiline Pragma syntax highlighting in TextViewer
authorLaurent Bessard
Thu, 09 May 2013 19:36:37 +0200
changeset 1108 1ec5b4d244f3
parent 1107 9303f6b900fe
child 1109 2dfad20abde3
Fix bug with multiline Pragma syntax highlighting in TextViewer
editors/TextViewer.py
--- a/editors/TextViewer.py	Thu May 09 18:49:08 2013 +0200
+++ b/editors/TextViewer.py	Thu May 09 19:36:37 2013 +0200
@@ -547,7 +547,8 @@
                 else:
                     self.SetStyling(current_pos - last_styled_pos, 31)
                 last_styled_pos = current_pos
-                state = SPACE
+                if state != DPRAGMA:
+                    state = SPACE
                 line = ""
                 line_number += 1
                 self.RefreshLineFolding(line_number)
@@ -579,7 +580,7 @@
                     state = SPACE
             elif state == DPRAGMA:
                 if line.endswith("}}"):
-                    self.SetStyling(current_pos - last_styled_pos + 2, 31)
+                    self.SetStyling(current_pos - last_styled_pos + 1, 31)
                     last_styled_pos = current_pos + 1
                     state = SPACE
             elif (line.endswith("'") or line.endswith('"')) and state not in [STRING, WSTRING]: