iafan / goplayspace

Advanced Go Playground frontend written in Go, with syntax highlighting, turtle graphics mode, and more
https://goplay.space
Other
982 stars 61 forks source link

unprintable string characters break cursor due to zero display width #18

Closed therealplato closed 6 years ago

therealplato commented 7 years ago

Trying to diagnose junk input bytes, I wanted to copy paste whatever it was I did successfully turn bytes into invisible string and copy paste, but the editor broke:

https://goplay.space/#Xfsy91fp2Z vs https://play.golang.org/p/Xfsy91fp2Z

therealplato commented 7 years ago

Might be fixed via #8

iafan commented 7 years ago

Do you mind sharing some screenshot/screencasting? I looked at your example, and it seems to be rendering properly for me. The non-printable characters inside the quotes are there, and caret behaves identically when going through them in both playgrounds.

therealplato commented 7 years ago

Should have mentioned I'm using firefox 55.0.3 https://www.youtube.com/watch?v=xbss4NGHWxM

iafan commented 7 years ago

Thanks. I can reproduce this in FF. This happens because FF renders these characters differently in the textarea and in the regular HTML (which rather looks like a bug on FF side). If you disable syntax highlighting in settings in Go Play Space, you will see what I mean. Not sure if this is fixable on my side, unless I completely change the editor component.