Posted 21 years ago
by Steven Liu

I am trying to define a SectionState for following constrcut:
Section Options
Option1=Val1
Option2=Val2
The "Section" keyword has no corresponding closing scope keyword, so I use a blank line. The state definition is:
<State Key="SectionState">
<Scopes>
<Scope>
<ExplicitPatternGroup Type="StartScope" Token="SectionStartToken" Style="KeywordStyle" PatternValue="SECTION" LookAhead="{NonWordMacro}" />
<RegexPatternGroup Type="EndScope" Token="SectionEndToken" Style="DefaultStyle" PatternValue="\n" LookAhead="[ \t]*\n" IsContentDivider="True" />
</Scope>
</Scopes>
</State>
SyntaxEditor recognizes the state correctly, but does not show the content divider. It seems the problem occurs when the EndScope pattern is whitespace.
I found a workaround: use PatternValue=".\n" for SectionEndToken. But it has the side effect of including the last non-whitespace char in EndScopeToken.
Is that a bug or am I missing something?
Steven
Section Options
Option1=Val1
Option2=Val2
The "Section" keyword has no corresponding closing scope keyword, so I use a blank line. The state definition is:
<State Key="SectionState">
<Scopes>
<Scope>
<ExplicitPatternGroup Type="StartScope" Token="SectionStartToken" Style="KeywordStyle" PatternValue="SECTION" LookAhead="{NonWordMacro}" />
<RegexPatternGroup Type="EndScope" Token="SectionEndToken" Style="DefaultStyle" PatternValue="\n" LookAhead="[ \t]*\n" IsContentDivider="True" />
</Scope>
</Scopes>
</State>
SyntaxEditor recognizes the state correctly, but does not show the content divider. It seems the problem occurs when the EndScope pattern is whitespace.
I found a workaround: use PatternValue=".\n" for SectionEndToken. But it has the side effect of including the last non-whitespace char in EndScopeToken.
Is that a bug or am I missing something?
Steven