A strange problem with triggers and CSS

SyntaxEditor for Windows Forms Forum

Posted 12 years ago by Kasper
Avatar
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:

<KeyPressTrigger Key="BlockTrigger" Character="{">
  <KeyPressTriggerValidStates>
    <KeyPressTriggerValidState State="DefaultState" />
  </KeyPressTriggerValidStates>
</KeyPressTrigger>
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? :)

Comments (8)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yes this is a tricky one that we're still trying to think of how to handle. It's the same thing as was posted here.


Actipro Software Support

Posted 12 years ago by Kasper
Avatar
Okay, I see. Is there a simple workaround of some sort? For now, it would be just fine if the trigger fired no matter what, as long as it's within a piece of CSS code. Would this be possible in some way, or do I have to wait for this to (hopefully) be fixed in a maintenance release? :)

Btw, this works just fine with PHP, but I guess there's a big difference somewhere which I don't get? :)
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
The only workaround is the handle KeyTyped and process it instead of using a trigger.

But nevertheless, this bug is now fixed for the next maintenance release.


Actipro Software Support

Posted 12 years ago by Kasper
Avatar
I'm happy to hear that! :)
Is the problem mentioned in http://www.actiprosoftware.com/Support/Forums/ViewForumTopic.aspx?ForumTopicID=1753 fixed as well?

Any releasedate for the maintenance release yet?
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yes that is fixed too. Not sure of the release date yet.


Actipro Software Support

Posted 12 years ago by Kasper
Avatar
Has this been released yet? Since the site has moved on to version 4, I'm finding it hard to see the latest version of 3.x. I would really like this fix, since my application is very close to final release!
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I believe that was released in the beginning of October when 4.0 came out. You can check your Organization Purchases list to see the latest v3.1 versions. You also can look in the Annoucements forum for them.


Actipro Software Support

Posted 12 years ago by Kasper
Avatar
You're right, I must have missed that release. Thank you, everything appears to be working out now :)
The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.