rust-playground icon indicating copy to clipboard operation
rust-playground copied to clipboard

Cursor position is wrong with special characters

Open tgross35 opened this issue 3 years ago • 4 comments

Hello all,

I haven't been able to find this written up anywhere, so here's the issue. Special characters cause the position to offset, probably due to the Unicode helpers. See the example here:

https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=b7401426cca8ddcc8a53cc025adb6b4c

Place your cursor somewhere after the fancy a and type, you'll be typing one letter behind what you expect

tgross35 avatar Jun 18 '22 23:06 tgross35

Which editor?

2A87E944-D4A6-4CE4-9292-051769D5DEA1

Which operating system?

Assuming you are using Ace, can you reproduce it on https://ace.c9.io/build/kitchen-sink.html

shepmaster avatar Jun 20 '22 11:06 shepmaster

@shepmaster you are correct, it's only on ace, noticed both on MacOS and Windows. Guess it's an easy fix to switch.

It is reproducable on that playground - just paste the in. It displays correctly but seems like cursor position / editing is char-based rather than grapheme-based

tgross35 avatar Jun 20 '22 18:06 tgross35

You'll need to file the issue with Ace, please. Feel free to link to the Ace issue from here once opened.

shepmaster avatar Jun 20 '22 18:06 shepmaster

Thanks for the link, looks like here is the tracked issue https://github.com/ajaxorg/ace/issues/4142

Please close or leave open as you see fit

tgross35 avatar Jun 20 '22 20:06 tgross35