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

Cursor position and line wrapping are wrong with proportional fonts. #4586

Closed
matj1 opened this issue Nov 27, 2021 · 2 comments
Closed

Cursor position and line wrapping are wrong with proportional fonts. #4586

matj1 opened this issue Nov 27, 2021 · 2 comments

Comments

@matj1
Copy link

matj1 commented Nov 27, 2021

When Ace editor uses a proportional font for the edited text, the cursor usually is in a wrong position, and the lines wrap wrongly. If the line contains narrow characters before the cursor, the cursor advances too fast for the line, so it's ahead of the place where the characters actually appear, and the line wraps too soon, because it's when the cursor reaches the end of the view, not the text.
If the line contains wide characters before the cursor, the cursor advances too slowly, so it's behind the place where the characters actually appear, and the line wraps too late, so some of the text is outside of the view. That makes the editor hardly useable with proportional fonts

I did a demonstration with Verdana Pro. Both lines 2 and 3 contain 80 characters, and both lines have a cursor at the end. The line with W's has the cursor displayed not far enough from the beginning of the line, and the line with i's has the cursor displayed too far from the beginning of the line. If I write some characters, they appear at the end of each line, which is not where the cursors are. Line 6 is wrapped too late, so “WWW21” and “WWW22” are outside of the view. Line 8 is wrapped too soon, so there is a lot of unused space at the end.

A picture of the demonstration:
Screenshot_20211127_155234

Expected behaviour: The cursor is displayed exactly at the position where the characters appear when they are written, and the lines wrap just when the text reaches the width of wrapping.

@jorgk3
Copy link

jorgk3 commented Nov 28, 2021

This was also reported for ThunderHTMLedit, a Thunderbird/Betterbird add-on which uses Ace for HTML editing in the compose/Write window of the e-mail client.

@andrewnester
Copy link
Contributor

Closing as duplicate of #460

@andrewnester andrewnester closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2022
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

3 participants