SyntaxEditor for Windows Forms Forum

Posted 14 years ago by Krispy
Hello - I have been trying to implement the DeleteHorizontalWhitespace method of the SyntaxEditor control.

If I select the following text and trigger the DeleteHorizontalWhitespace method:

(where '.' is whitespace)

I would expect to see "abc" in the editor, however the following string is displayed instead:


If I trigger the DeleteHorizontalWhitespace method for a second time, the editor displays "abc", which is what I was expecting the first time the method was fired.

Is this a bug with the DeleteHorizontalWhitespace method or is my understanding of the method flawed?

Thanks in advance.

Comments (2)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
No this two-stage approach is by design since it mimics how Visual Studio works exactly. And it is quite handy in certain scenarios.

The first pass only happens if there is a run of more than one whitespace in the selection. In that case it normalizes all the whitespace down to a single space.

The second pass occurs if the selection only contains single spaces. In that case it removes the spaces.

Actipro Software Support

Posted 14 years ago by Krispy
Great - thanks for clearing that up and thanks for the swift reponse.

Much appreciated.
The latest build of this product (v21.1.0) was released 18 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.