Tweets by @Actipro
Please take some time to learn more about us and our product offerings.
As I mentioned in the previous blog post, we've been working on core editing functionality for the WPF version of SyntaxEditor. One feature that isn't in our WinForms version but that we always wanted to add is support for right-to-left languages inline with code.
Bi-directional display of text is a tricky thing because as soon as you enter a sequence of right-to-left characters such as Arabic or Hebrew, the entire sequence is flipped over and directional left/right arrow keys move the caret in the opposite direction.
SyntaxEditor for WPF showing the partial selection of some Arabic text
So in the screenshot above, say you have the caret at the left quote (fourth character) on line 6. If you press your right arrow, the caret jumps to just before the right quote after the Arabic "Hello world" text, since this is considered "before" the Arabic sequence of characters. If you press right arrow again, it moves one character to the left, and into the Arabic section. This continues until you reach the leftmost side of the Arabic sequence, and the caret moves to the right quote again. From that point on, right arrow moves to the right since it is back in left-to-right mode.
In the screenshot, the selection was anchored at the start of the "SyntaxEditor" word on line 5 and then the caret was moved down to line 6 into the Arabic sequence of characters. You can see how the selection properly splits to show the contiguous sequence of characters that are selected.
August 7, 2008 at 17:29
While I tend to advocate using English in all source code and comments, the geek inside of me can't help but be impressed .