Skip to content
This repository has been archived by the owner on Oct 16, 2019. It is now read-only.

The cursor has a problem, the location is displayed. #39

Closed
xubing6243 opened this issue Aug 27, 2015 · 27 comments
Closed

The cursor has a problem, the location is displayed. #39

xubing6243 opened this issue Aug 27, 2015 · 27 comments

Comments

@xubing6243
Copy link

os: windows7
86002397-156f-4e5d-b382-b1955e33836e

@matthew-dean
Copy link
Member

Is the cursor always in the wrong position for you, or under certain conditions (resizing, switching tabs, etc)? Do any of those actions correctly re-position the cursor?

@xubing6243
Copy link
Author

I am not very clear, this problem is not often appear! I don't know what's causing it!

I'll be testing for a while, and so have the results to tell you!

@Pantyboy
Copy link

Pantyboy commented Sep 3, 2015

My cursor has an "extra" space between the character and the cursor itself.

It took me several attempts to delete a character before I figured this one out.

@matthew-dean
Copy link
Member

@Pantyboy Also on Windows? If so, what version?

@TommyTheBlackbird
Copy link

It happens to me in Windows 10 (64 bits).
Crunch 2.0.5 - beta 5

@Pantyboy
Copy link

Pantyboy commented Sep 4, 2015

@matthew-dean I'm using Crunch 2 Pro on Windows 10, 64 bit.

@matthew-dean
Copy link
Member

This one will probably prove difficult. It's either an Ace (editor) bug or a bug in Chromium for Windows. The only way this would happen (I think) is if it measured character width and the browser engine returned an inaccurate width.

See if you can note any pattern, like resizing / switching / anything like that. I might be able to make a workaround if I know where it happens.

@matthew-dean
Copy link
Member

@Pantyboy For you, is this a problem all the time? And if it's all the time, is it a problem no matter where the cursor is on the line? (For example, is it as "wrong" at the beginning of the line as a long line, or does the distance shift?)

@Pantyboy
Copy link

Pantyboy commented Sep 9, 2015

@matthew-dean The gap is only really visible at the end of the line so this is only when you notice the problem.

crunch_cursor_gap

@PSEAlex
Copy link

PSEAlex commented Sep 14, 2015

crunch2

@ghost
Copy link

ghost commented Sep 23, 2015

screencap

Screen cap of the cursor issue in beta 6. I had just typed the 'x' in the screenshot. If I were to backspace once from where the cursor is the 'x' would be deleted.

@matthew-dean
Copy link
Member

This is technically an Ace issue, which I've raised with them, but I'll try to keep figuring out a workaround. I think rather than measuring the actual position of those characters, Ace attempts to math it out by measuring individual characters and some similar CSS to what's rendered in order to guess the cursor position. It appears those guesses are sometimes wrong under some unknown circumstances which seem to have been triggered in Crunch.

@matthew-dean
Copy link
Member

Is this still an issue as of beta 8 for you in Windows?

@Pantyboy
Copy link

@matthew-dean From my perspective, this is fixed. Great job!

@sacerro
Copy link

sacerro commented Oct 19, 2015

No problem with beta 8 on Windows 10 x64

@TommyTheBlackbird
Copy link

I'm still having some cursor issues (beta8 Win10 x64). The problem seems to appear when the cursor is next to some mark characters like colon and semicolon.

crunch2-beta8-win10x64-cursor

@matthew-dean matthew-dean added this to the beta.9 milestone Oct 19, 2015
@matthew-dean
Copy link
Member

@TommyTheBlackbird Nuts. It's hard to guess where the failure point is. It might be some combination of how Ace is measuring lines + font + Chrome + Windows font rendering. Are all of you in the Facebook beta testing group? I might have to do some test builds with slightly different settings to see what fixes it for you.

@nightwing
Copy link
Contributor

@TommyTheBlackbird could you try the editor at https://ace.c9.io/#nav=about?

@matthew-dean
Copy link
Member

Ah, I can reproduce now in a Parallels virtual Win 10.

@matthew-dean
Copy link
Member

Apparently Atom, which is pretty similar to NW.js as far as platform, has had lots of text-measuring issues, especially in regards to text-rendering: optimizeLegibility, and fonts with ligatures like Hasklig, which Crunch is currently using. See: atom/atom#8811.

In the short term, if Ace doesn't have a fix, I might try to sub in Source Code Pro (which Hasklig is based on), and turn off optimizeLegibility (or text-rendering: geometricPrecision which I also have tried).

@matthew-dean
Copy link
Member

Okay, with some more testing, I could reproduce cursor positioning problems on both Mac & Windows, not just Windows. After toggling text-rendering settings on/off, I think the problem might, in fact, be Hasklig, which claims to be a monospace font, but ends up not being monospace in Chromium. Ace only works with monospace fonts, so this is probably the issue. I'll do some test builds with Source Code Pro & text-rendering settings turned off for the editor.

@matthew-dean
Copy link
Member

The problem was not the font. What the problem is, I'm not exactly sure, but I think I have a working workaround.

@matthew-dean
Copy link
Member

Fixed in beta 9.

@TommyTheBlackbird
Copy link

Fix confirmed here! Nice job!

@PSEAlex
Copy link

PSEAlex commented Oct 21, 2015

beta9 on win7 home premium x64 - working fine 👍

@matthew-dean
Copy link
Member

*whew *

@SBRK
Copy link

SBRK commented Aug 29, 2018

I had the same problem, only on Mac. On words like "difficult" the f and i would get grouped. This was due to a global font-feature-settings: liga I had.

I added

  font-feature-settings: "liga" 0;
  font-variant-ligatures: none;

To my Ace editor wrapper and voila

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

No branches or pull requests

8 participants