Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Wrong cursor positioning with complex scrips #6301

Open
santhoshtr opened this issue Dec 22, 2013 · 8 comments
Open

Wrong cursor positioning with complex scrips #6301

santhoshtr opened this issue Dec 22, 2013 · 8 comments

Comments

@santhoshtr
Copy link

Paste the following text to brackets, and see where the cursor is placed

സന്തോഷ്

Cursor is supposed to place at end of the word, but in brackets it is after 4 or 5 character width.

brackets

Happens with all non-latin complex scripts

@peterflynn
Copy link
Member

Reproduces in vanilla CodeMirror too

@santhoshtr
Copy link
Author

It seems bracket is placing the cursor based on the character count. The word സന്തോഷ് has 7 unicode characters. But the visual width is not 7 X character width. For complex scripts, the characters combine and form ligatures. Browsers can do this natively, overriding it using user level logic is bad idea.

@ghost ghost assigned njx Jan 6, 2014
@njx
Copy link
Member

njx commented Jan 6, 2014

Doesn't seem to repro in CM in FF, so this might be a Chrome-only CM issue.

@njx
Copy link
Member

njx commented Jan 6, 2014

To me to file against CM

@santhoshtr
Copy link
Author

What is CM?

@peterflynn
Copy link
Member

@santhoshtr CM is referring to CodeMirror, the code-editor UI widget that Brackets uses.

@santhoshtr
Copy link
Author

Ok, reported there codemirror/codemirror5#2115

@njx
Copy link
Member

njx commented Jul 10, 2014

FYI, it looks from the CM bug thread like Marijn has been trying to fix this, but is hampered by lack of a good way to detect grapheme clusters from JS. Maybe someone from Web Platform has some knowledge in this area?

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

3 participants