Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect cursor position in Chrome #3036

Closed
adamcikado opened this issue Jul 23, 2016 · 7 comments
Closed

Incorrect cursor position in Chrome #3036

adamcikado opened this issue Jul 23, 2016 · 7 comments

Comments

@adamcikado
Copy link

adamcikado commented Jul 23, 2016

Cursor has incorrect position when you edit longer line in Chrome 51 on Mac OS X.

screen shot 2016-07-23 at 23 40 27

@atifsaddique211f
Copy link

atifsaddique211f commented Jan 26, 2017

I am also having this issue for both chrome and firefox on Linux

@ianformanek
Copy link

This issue is still very easily reproducible in the standard ACE kitchen sink:

  • https://ace.c9.io/build/kitchen-sink.html
  • add text with > 2000 chars on single line, with lots of spaces or commas, possibly also other special characters
  • disable soft wrap
  • Mac OS Chrome and Safari (Safari has slightly different, but also incorrect, cursor offset). OK in Firefox.

Problem:

  • last few characters are not visible
  • towards the end of the line, the cursor position is off by 1-2 chars making editing very hard

Examples of text exhibiting the problem:

1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 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3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234,1234

@rismanrp
Copy link

rismanrp commented Jul 7, 2020

This issue is still happening on Chrome for Windows 10. In my case there's no excessive amount of spaces or commas, but just a veeery long line (±110,000 characters long). And at the end of it the cursor is off by ±40 characters.

I know even in my edge case the users are not expected to edit it, but what makes it a huge problem for me is that my users are navigating markers in those lines and the markers are off too. A marker at column ~20.000 is already off by 8 characters.

@vvrein
Copy link

vvrein commented Feb 13, 2021

After some research, I found that my manually configured fontconfig was the root issue of very similar behavior.
Here how it was:
output

Here how it works after removing font binding:
output

My part of config that caused this:

        <match>
                <edit mode="prepend" name="family"><string>Noto Sans</string></edit>
        </match>

in .config/fontconfig/fonts.conf

UPD: Added from arangodb/arangodb#13117 (comment)


The general point of all this strangenesses is that (my pov):

  1. Ace expects monospace font
  2. Ace calculates the carriage position based on:
    1. single character width
    2. how many characters are from the beginning of the line, to current position

So, broken behavior could be part of "no monospace font got when requested".


My system is Arch Linux + Sway + most configs done manually.
My initial bug was with Gollum editor, and I was able to reproduce same bug on https://ace.c9.io/
Then, I tried to reproduce bug on https://ace.c9.io/ on other linux machine, but cant.
Then, I launched new fresh Arch setup in VM, but without any configuration, and tried to reproduce Ace bug, but still can't.
So, it gave me an idea that bug can be caused with something related to only my system. One more thing is that this bug was in any browser on my system: firefox, google chrome, chromium.
Then I began to delete/install different fonts, as initially I thought that there was no needed font on my system.
When I deleted noto-fonts - Ace began works correctly. So it gives me point to further search.
Then, on some point, I finded out, that my fontconfig was the root cause of the issue!
The only thing left was to find the necessary lines.

<match>
    <edit mode="prepend" name="family"><string>Noto Sans</string></edit>
</match>

Why and for what reason I added those lines to my fontconfig - is a kind of a mystery for me :)
But but I can say for sure that I did it by myself years ago, for whatever reason...


One more thing: when I discovered this bug, I have tried disable/enable/tweak every style related to the input area of Ace, but without any luck, so I was sure that it was not caused by any of page styles.

@github-actions
Copy link

github-actions bot commented May 9, 2022

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@ianformanek
Copy link

This issue is still happening and still reproducible in the standard ACE kitchen sink (https://ace.c9.io/build/kitchen-sink.html) as per the steps described in my earlier comment.

IMO the importance of the mobile experience will only grow bigger over time, so this would be a good thing to improve, even if this is an edge-case.

@andrewnester
Copy link
Contributor

Fixed in 1.13.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants