Posted 10 years ago by Avatar 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 10 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 10 years ago by Krispy
Great - thanks for clearing that up and thanks for the swift reponse.

Much appreciated.
Information The latest build of this product (2016.1 build 0330) was released 11 months ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.