Xiaoguang,
thanx for bringing this up!
I’m aware of a couple of issues with unicode characters in the code editor.
One is that the editor assumes the font to me mono-spaced, but even though it is, some characters draw at different widths, including Chinese ones. This causes the cursor to be drawn visually at a wrong offset not corresponding to the underlying test (ie if the cursor is at column 10, it will be drawn at 10x{character width}, and this appear too far to the left.
This isn’t as easy to solve as it might seem because, again, the editor code assumes it can rely on theca ebbing unicode.
I’m making some fixes now that will adjust the drawing to better reflect this, for the next build. The far tricker part will be to auto take this into account for cursor navigation and mouse clicks (eg preying custom down on column 10 of latin characters to a line with Chinese characters will, for now, still brung you to column 10 of the Chinese text (though visually that will mean your cursor did not move straight down, but a few characters to the right. Similar, clicking into a Chinese text will (for now) place the cursor on the column as determined by the latin character width, so again, the cursor will end up too far right.
But, at least, where you see the cursor will correspond to where it locally is, relative to the text, so you won’t get bad surprises when typing. I hope that’s a reasonable partial solution for now, until I find a full solution.
A somewhat related problem, this is even worse when using Unicode characters that are using surrogate pairs (eg emoji) or, worse, combined emoji. Again these will render correctly, but they throw off the cursor position even worse. This is not woo fixed (for single-part emojis), but what problem remains is that you can still place the cursor "in the middle’ of one, because it’s represented by two chars. This will need more work solving.
I’d like to send you new Water build later today to get your feedback on the changes I have made so far. What’s your remobjects.com account name?
thanx,
marc