Posted 19 years ago
by Kasper

Hi,
I wish to autocomplete a block for my users, by inserting a } (plus a linebreak and some tabbing etc.) whenever they write a { character. I've done it with PHP, where it works just fine. Now I wanted to do it with CSS, but I'm having a some what strange problem. I'm using this trigger:This works perfectly well if I'm using CSS as my main highlighter. However, if it's used as part of an HTML document, between a set of <style> tags, it doesn't work. I've tested this with the demo as well, and it should be simple to reproduce. Simply add the above snippet to the ActiproSoftware.CSS.xml file. Start the demo app, and load the CSS language. Press the { key, and the Trigger event is fired. Now load the HTML language, and do the same within the style block. The event is NOT fired. What's going on? :)
I wish to autocomplete a block for my users, by inserting a } (plus a linebreak and some tabbing etc.) whenever they write a { character. I've done it with PHP, where it works just fine. Now I wanted to do it with CSS, but I'm having a some what strange problem. I'm using this trigger:
<KeyPressTrigger Key="BlockTrigger" Character="{">
<KeyPressTriggerValidStates>
<KeyPressTriggerValidState State="DefaultState" />
</KeyPressTriggerValidStates>
</KeyPressTrigger>