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

input cursor between lines (when using custom document zoom levels) #32

Open mvolkmann opened 5 years ago

mvolkmann commented 5 years ago

Lately I've noticed that for longer code snippets the placement of the insert cursor is off. It becomes unclear which line it is on. I suspect this is a CSS issue related to line height.

iafan commented 5 years ago

What browser/OS do you experience this with? Does changing the browser fix the issue or not? Do you have a text snippet that would help reproduce the issue? If you could reduce the snippet to as few lines as possible, that would help as well.

Meanwhile, as a workaround, disabling syntax highlighting should fix the caret positioning issue.

mvolkmann commented 5 years ago

On Mon, Dec 31, 2018 at 11:59 PM Igor Afanasyev notifications@github.com wrote:

What browser/OS do you experience this with?

Chrome on macOS

Does changing the browser fix the issue or not?

Yes! I cannot reproduce the issue in Firefox or Safari.

Do you have a text snippet that would help reproduce the issue? If you could reduce the snippet to as few lines as possible, that would help as well.

The specific text doesn't seem to matter. As long as there 25 lines or more, I can reproduce the problem.

Meanwhile, as a workaround, disabling syntax highlighting should fix the caret positioning issue.

Yes, that works. Of course I really like to use syntax highlighting. ;-)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/iafan/goplayspace/issues/32#issuecomment-450711478, or mute the thread https://github.com/notifications/unsubscribe-auth/AAE10DgTdMKQ916PoFEX4F0Tbl0yAoPrks5u-vk4gaJpZM4ZglAR .

-- R. Mark Volkmann Object Computing, Inc.

zimnx commented 5 years ago

selection_069 Simillar issue on Google Chrome on Linux v69.0.3497.100-1. Not exactly between lines, but cursor is shifted when zoom is applied to site. Above screenshot was taken on 75% zoom, on 100% zoom cursor matches line.

iafan commented 5 years ago

@zimnx thanks! I can definitely see caret misalignment at 75% zoom level.

@mvolkmann, are you also using some custom zoom level?

mvolkmann commented 5 years ago

I didn't realize I was at a custom zoom level, but it turns out I was at 90%. Switching to 100% fixed the issue.

Should the cursor be positioned correctly at any zoom level? On "The Go Playground" when I change the zoom level the cursor is still positioned correctly.

iafan commented 5 years ago

Should the cursor be positioned correctly at any zoom level?

Oh yeah, for sure. So it's definitely a bug; I just wanted to make sure if it's the same kind of bug or a different one. :)

Streppel commented 4 years ago

playbug

Same here

Firefox 77.0.1 (64-bit) running on Arch Linux 5.7.4-arch1-1

ansiwen commented 3 years ago

Same problem here with Chrome on Fedora Linux and a custom font scaling. The issue is related to syntax highlighting, which increases the line height, but selected text and the cursor still use the original font height. Disabling the syntax highlighting lets the selected text be aligned again.(That has been mentioned above already.)