Snapshot.GetWordTextRange(offset) gives unexpected value for whitespace/carriage returns

SyntaxEditor for WPF Forum

Posted 8 years ago by Xinen Lee
Version: 15.1.0624

I'm getting some inconsistent/unexpected values when calling GetWordTextRange.


Type "<tab><tab><enter><tab><tab>" in the editor, resulting in "\t\r\n\t\t"

  • GetWordTextRange() with offset 0, 1, 2 returns "\t\t"
  • GetWordTextRange() with offset 3, 4, 5 returns "\t\r\n\t\t"


1. Why doesGetWordTextRange() for offset 3, 4, 5 include the text in the first line, whereas GetWordTextRange() for offset 0, 1, 2 does not include the text in the second line? This is inconsistent.

2. What's considered a word? Is a tab a word? Shouldn't each of the calls for GetWordTextRange() for offsets 0, 1, 2, 3, 4, 5 each return me just one "\t" or "\r\n"?

Comments (1)

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


Thank you for reporting this issue.  We've fixed it for the next maintenance release so that clicking on the second line just highlights that line's tabs.

The word is effectively what you get when you double-click something.  When double clicking a series of tabs, it will be all the sequential tabs.

Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.