Posted 13 years ago by Richard Beyer - KBS Leipzig
Avatar
After _editor.SelectedView.InsertSurroundingText(openingTag, closingTag);

the selection gets lost. How do I select the original text again to do another .InsertSurroundingText?

greetings
Richard

EDIT: found it after starting this thread ^^

int selectionstartingposition = _editor.SelectedView.Selection.FirstOffset;
int selectionlength = _editor.SelectedView.Selection.Length;
_editor.SelectedView.InsertSurroundingText(openingTag, closingTag);
_editor.SelectedView.Selection.SelectRange(selectionstartingposition+openingTag.Length,selectionlength);
[Modified at 08/24/2006 07:59 AM]

Comments (1)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Richard,

We've also added a couple new overloads to InsertSurroundingText for v4.0. One of them lets you indicate that you want to reselect the inner contents.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.