WordWrap suggestion with punctuation character

SyntaxEditor for Windows Forms Forum

Posted 18 years ago by Sébastien Hivon

I have a suggestion for the word wrap.
If I select "WordWrap" by "Word", a punctuation character did not count to be embedded with the word before or after and is wrapped separatly.

For example,

"This is a dog," the comma will not wrap with the word "dog", but wrap alone.

Comments (3)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Thanks for the suggestion. I'll write it down.

Actipro Software Support

Posted 12 years ago by Jon Heaton

I am having the same problem with the word wrap.  There are many punctuation characters that reproduce this problem. Couldn't you just redefine the tokenizer to parse words as { alphamacro }+ { punctuationmacro }* { alphamacro }+ and it would fix the problem? 

Also, more specifically, the '-' character wraps the '-' to the next line instead of conventionally keeping the '-' on the upper line and wrapping text after the '-' to the next line.  I would be content if the whole word wrapped to the next line if it contained any punctuation characters, but if you have time, I would love to have it work completely as expected. 

Thank you for your work, this is a great product.

Answer - Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Jon,

Sorry for the late reply, it looks like we didn't get a notification email for this post for some reason.

When the word wrap type is set to Word, it will use the language's IWordBreakFinder to determine where words are.  Specifically it will call the FindNextWordStart method.  So you could override the IWordBreakFinder of your language to alter that behavior.  Note that it will affect other things like Ctrl+Arrow movement, etc. too.

Or if you set the word wrap type to Token, it will wrap based on how the lexer tokenized the text.

Hope that helps!

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.