wordplaydev / wordplay

An accessible, language-inclusive programming language and IDE for creating interactive typography on the web.
Other
60 stars 22 forks source link

Commenting out causes the cursor to not go near the first star #504

Closed chiisanadev closed 3 months ago

chiisanadev commented 3 months ago

Expected behavior

When commenting something out, the cursor should be able to go by the first *

Actual behavior

  1. Click the ** button to comment out some code
  2. Try to move the cursor to the beginning of the commented-out section of the code
  3. Notice that the cursor will not go by the first *
  4. When you click the right arrow once and then delete at the position it will not move from, it deletes the first star.

Screenshots

Screenshot 2024-06-28 at 4 38 31 PM

Environment

Desktop

amyjko commented 3 months ago

Thanks Rayana! I'll investigate.

amyjko commented 3 months ago

It looks like this issue was related to emojis, which are both more than one character when encoded, and non-fixed width. I rewrote the space measurement algorithm to account for both, so it should be much more robust to non-whitespace characters in comments now.