DeleteHorizontalSpace

SyntaxEditor for Windows Forms Forum

Posted 13 years ago by Krispy
Avatar
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:

Quote:
a.......b.......c
(where '.' is whitespace)


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

Quote:
a.b.c


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 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
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 13 years ago by Krispy
Avatar
Great - thanks for clearing that up and thanks for the swift reponse.

Much appreciated.
The latest build of this product (v2020.1 build 0400) was released 7 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.