icsharpcode / AvalonEdit

The WPF-based text editor component used in SharpDevelop
http://avalonedit.net/
MIT License
1.85k stars 469 forks source link

Override color preview #377

Open NotroDev opened 1 year ago

NotroDev commented 1 year ago

Hey. I have this ruleset for color preview:

<RuleSet name="ColorsRuleSet">
    <Span foreground="#FF5555" ruleSet="TestRuleSet">
        <Begin>(&amp;[clkmno])+(?:[^;&quot;&amp;]|&quot;&quot;)*(?=[;&quot;&amp;])</Begin>
        <End></End>
    </Span>
    <Span foreground="#AA0000" ruleSet="TestRuleSet">
        <Begin>(&amp;[4lkmno])+(?:[^;&quot;&amp;]|&quot;&quot;)*(?=[;&quot;&amp;])</Begin>
        <End></End>
    </Span>

    <Import ruleSet="TestRuleSet" />
</RuleSet>

But this overrode my percent-expressions (e.g. %player%) so I moved it to the other ruleset and added it to the ColorsRuleSet, but it doesn't work:

<RuleSet name="TestRuleSet">
    <Rule color="BracedExpression">
        %[^%{}]*[{}][^%]*%[^%]*%[^%{}]*[{}][^%]*%|%[^%]*%
    </Rule>
</RuleSet>

It's like this: obraz

But it should be like this: obraz