--- a/editors/TextViewer.py Thu Oct 25 19:57:53 2012 +0200
+++ b/editors/TextViewer.py Thu Oct 25 19:59:06 2012 +0200
@@ -47,7 +47,7 @@
[STC_PLC_WORD, STC_PLC_COMMENT, STC_PLC_NUMBER, STC_PLC_STRING,
STC_PLC_VARIABLE, STC_PLC_PARAMETER, STC_PLC_FUNCTION, STC_PLC_JUMP,
STC_PLC_ERROR, STC_PLC_SEARCH_RESULT] = range(10)
-[SPACE, WORD, NUMBER, STRING, WSTRING, COMMENT, PRAGMA] = range(7)
+[SPACE, WORD, NUMBER, STRING, WSTRING, COMMENT, PRAGMA, DPRAGMA] = range(8) [ID_TEXTVIEWER, ID_TEXTVIEWERTEXTCTRL,
] = [wx.NewId() for _init_ctrls in range(2)]
@@ -595,12 +595,16 @@
current_context = self.Variables
- elif line.endswith("{") and state != PRAGMA:
+ elif line.endswith("{") and state not in [PRAGMA, DPRAGMA]: self.SetStyling(current_pos - last_styled_pos, 31)
last_styled_pos = current_pos
current_context = self.Variables
+ elif line.endswith("{{") and state == PRAGMA: + self.SetStyling(current_pos - last_styled_pos, 31) + last_styled_pos = current_pos self.SetStyling(current_pos - last_styled_pos + 2, STC_PLC_COMMENT)
@@ -608,6 +612,11 @@
+ self.SetStyling(current_pos - last_styled_pos, 31) + last_styled_pos = current_pos + if line.endswith("}}"): self.SetStyling(current_pos - last_styled_pos + 2, 31)
last_styled_pos = current_pos + 1
@@ -838,7 +847,7 @@
kw = self.Variables.keys()
- kw = self.Keywords + self.Variables.keys() + self.Functions
+ kw = self.Keywords + self.Variables.keys() + self.Functions.keys() kw = [keyword for keyword in kw if keyword.startswith(words[-1])]