--- a/editors/TextViewer.py Thu Apr 28 15:21:02 2016 +0300
+++ b/editors/TextViewer.py Thu Apr 28 16:54:01 2016 +0300
@@ -47,7 +47,8 @@
[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)
+ STC_PLC_ERROR, STC_PLC_SEARCH_RESULT, + STC_PLC_EMPTY] = range(11) [SPACE, WORD, NUMBER, STRING, WSTRING, COMMENT, PRAGMA, DPRAGMA] = range(8)
[ID_TEXTVIEWER, ID_TEXTVIEWERTEXTCTRL,
@@ -577,7 +578,7 @@
current_context = self.Variables
- self.SetStyling(current_pos - last_styled_pos + 1, STC_PLC_COMMENT)
+ self.SetStyling(current_pos - last_styled_pos, STC_PLC_COMMENT) self.SetStyling(current_pos - last_styled_pos, STC_PLC_NUMBER)
@@ -594,33 +595,33 @@
elif word in self.EnumeratedValues:
self.SetStyling(current_pos - last_styled_pos, STC_PLC_NUMBER)
- self.SetStyling(current_pos - last_styled_pos, 31)
+ self.SetStyling(current_pos - last_styled_pos, STC_PLC_EMPTY) if word not in ["]", ")"] and (self.GetCurrentPos() < last_styled_pos or self.GetCurrentPos() > current_pos):
self.StartStyling(last_styled_pos, wx.stc.STC_INDICS_MASK)
self.SetStyling(current_pos - last_styled_pos, wx.stc.STC_INDIC0_MASK)
self.StartStyling(current_pos, 0xff)
- self.SetStyling(current_pos - last_styled_pos, 31)
+ self.SetStyling(current_pos - last_styled_pos, STC_PLC_EMPTY) last_styled_pos = current_pos
+ if (state != DPRAGMA) and (state != COMMENT): self.RefreshLineFolding(line_number)
elif line.endswith("(*") and state != COMMENT:
- self.SetStyling(current_pos - last_styled_pos - 1, 31)
+ self.SetStyling(current_pos - last_styled_pos - 1, STC_PLC_EMPTY) last_styled_pos = current_pos
current_context = self.Variables
elif line.endswith("{") and state not in [PRAGMA, DPRAGMA]:
- self.SetStyling(current_pos - last_styled_pos, 31)
+ self.SetStyling(current_pos - last_styled_pos, STC_PLC_EMPTY) last_styled_pos = current_pos
current_context = self.Variables
elif line.endswith("{{") and state == PRAGMA:
- self.SetStyling(current_pos - last_styled_pos, 31)
+ self.SetStyling(current_pos - last_styled_pos, STC_PLC_EMPTY) last_styled_pos = current_pos
@@ -630,16 +631,16 @@
- self.SetStyling(current_pos - last_styled_pos, 31)
+ self.SetStyling(current_pos - last_styled_pos, STC_PLC_EMPTY) last_styled_pos = current_pos
- self.SetStyling(current_pos - last_styled_pos + 1, 31)
+ self.SetStyling(current_pos - last_styled_pos + 1, STC_PLC_EMPTY) last_styled_pos = current_pos + 1
elif (line.endswith("'") or line.endswith('"')) and state not in [STRING, WSTRING]:
- self.SetStyling(current_pos - last_styled_pos, 31)
+ self.SetStyling(current_pos - last_styled_pos, STC_PLC_EMPTY) last_styled_pos = current_pos
current_context = self.Variables
@@ -662,7 +663,7 @@
- self.SetStyling(current_pos - last_styled_pos, 31)
+ self.SetStyling(current_pos - last_styled_pos, STC_PLC_EMPTY) last_styled_pos = current_pos
@@ -670,7 +671,7 @@
elif char in NUMBERS or char == '.' and state != WORD:
- self.SetStyling(current_pos - last_styled_pos, 31)
+ self.SetStyling(current_pos - last_styled_pos, STC_PLC_EMPTY) last_styled_pos = current_pos
elif state == WORD and char != '.':
@@ -693,7 +694,7 @@
elif word in self.EnumeratedValues:
self.SetStyling(current_pos - last_styled_pos, STC_PLC_NUMBER)
- self.SetStyling(current_pos - last_styled_pos, 31)
+ self.SetStyling(current_pos - last_styled_pos, STC_PLC_EMPTY) if word not in ["]", ")"] and (self.GetCurrentPos() < last_styled_pos or self.GetCurrentPos() > current_pos):
self.StartStyling(last_styled_pos, wx.stc.STC_INDICS_MASK)
self.SetStyling(current_pos - last_styled_pos, wx.stc.STC_INDIC0_MASK)
@@ -757,9 +758,9 @@
elif word in self.EnumeratedValues:
self.SetStyling(current_pos - last_styled_pos, STC_PLC_NUMBER)
- self.SetStyling(current_pos - last_styled_pos, 31)
+ self.SetStyling(current_pos - last_styled_pos, STC_PLC_EMPTY) - self.SetStyling(current_pos - start_pos, 31)
+ self.SetStyling(current_pos - start_pos, STC_PLC_EMPTY) self.ShowHighlights(start_pos, end_pos)