Spaces around operators...

SyntaxEditor for Windows Forms Forum

Posted 16 years ago by Kevin Bennett
I am using the VBDotNet XML language file definition for a project that requires me to replace some simplified code with more complicated code before compiling.

One of the things I need to do is automatically put a space before and after each operator. This can be done all at once right before compile, or while the user is typing it in. Can you point me in the right direction? Should I use a textstream to find all operators and put whitespaces around them? Should I use an autoreplace in the language definition so that when they enter an operator it puts spaces around it?

Thanks for you help

Comments (1)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Kevin,

I don't think autoreplace would work for you since you need to not do this if there is already space around the operators. A TextStream as you said is one way to scan the Document.

Alternatively maybe handle SelectionChanged and in there, if the caret's line has changed, scan the previously selected line for operators and change it then. That's how a lot of corrections work when doing them at run-time.

Actipro Software Support

The latest build of this product (v24.1.0) was released 4 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.