Posted 15 years ago by screamingclown
Avatar
I was using the GoToPreviousBracket() and GoToNextBracket() methods in a project in version 1.0 of the Syntax Editor.
I see that it is not available ( or at least I cannot find it ).
Is there a new way to do this, or a better way?

I have a need to move the cursor position to a StartTagStartToken and EndTagEndToken based on a character position.

More specifically, I have an XML document, and whereever the user clicks I want the ability to get the entire text of the Node. Basically I used to use GoToPrevious, and then GoToNext and I could get it.

Just wondering if there is another way.

Thanks
Jeff Easton

Comments (3)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Since bracket highlighting was redesigned in 2.0 to be more robust, the BracketSet object is no longer used. Both the GoToPreviousBracket() and GoToNextBracket() methods took a BracketSet parameter so they are no longer valid.

The way to do what you want in 2.0 is to get a TextStream at the current caret offset. Then iterate through the Tokens backwards and look for a Token.Key with the start delimiter you want. Once found, iterate forwards through the Tokens until the end delimiter is found.

Maybe in the future we can add a couple goto Token methods to search forwards or backwards for a particular Token key to make that process easier.


Actipro Software Support

Posted 15 years ago by screamingclown
Avatar
Ok, good enough. I knew that was an option, just didn't know if it was the best one.
Thanks for the answer.

Jeff Easton
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Just implemented overloads for GoToNextToken and GoToPreviousToken that accept a key. It will search for tokens with the specified key. This will be in the next release.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 7 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.