Posted 18 years ago by Kasper
Avatar
Hi,

I would like to take a range of text in the SyntaxEditor, and replace it with some other text. Usually, I would simply select the text, using Editor.SelectedView.Selection.StartOffset and Editor.SelectedView.Selection.EndOffset, and then setting the Editor.SelectedView.SelectedText. This works, but unfortunately, it's slow. It's easy to see that the text is being selected and replaced, and this is in a document with only very few lines. It looks silly, and I would prefer if the user was not able to see what's actually going on, since I have to do this whenever the user changes a property in a PropertyGrid-like control, which can happen many times. What is the recommended way for doing this?

Comments (2)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yeah definitely don't do it that way. One thing is to use editor.Document.UndoableInsert. That will change text optionally without changing the selection.

Also in v4.0, a new feature is the ability to suspend lexical parsing temporarily while you make mass changes.


Actipro Software Support

Posted 18 years ago by Kasper
Avatar
Hi,

>Yeah definitely don't do it that way. One thing is to use editor.Document.UndoableInsert. That will change text optionally without changing the selection.

Ah yes, that works like a charm! So much to learn when using a new & advanced control :)

>Also in v4.0, a new feature is the ability to suspend lexical parsing temporarily while you make mass changes.

I think that sounds like a really good idea. I have been looking for a BeginUpdate/EndUpdate-way of doing changes, but I couldn't seem to find it.
The latest build of this product (v24.1.1) 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.