Last modified: 2014-03-01 14:34:48 UTC
As an alternative to replacing Ace we should investigate how difficult it would be to modify Ace to either work correctly or show some fallback behavior with sane cursor positioning.
It looks like Ace already has special handling for CJK ideographic characters, which in "monospace" require two characters worth of width.
I may be able to adapt this to give a funky-looking, but usable, "monospace"-like behavior for characters from complex scripts. Looking into it...
Upstream bug: https://github.com/ajaxorg/ace/issues/460 "Support varying character widths"
Another more specific upstream bug that probably will get duped to that: https://github.com/ajaxorg/ace/issues/1594 "cursor doesn't work in multibyte text"
The first bug has an old patch which might help.
The old patch is a "proper" fix that attempts to support non-monospace fonts in general. Trying to update it to current ace master.
... so far so good, seems to be working: https://github.com/ajaxorg/ace/pull/1608
Here's a live demo:
(In reply to comment #4)
However, the following does not work (FF 23):
* Paste it into your kitchen sink https://brionv.com/misc/demo/ace/build/kitchen-sink.html
* Set the carret behind the first "return;"
* Press Enter. Result:
*caret = text cursor
Ok, looks like that may be the tab character bug mentioned on the original patch. I'll look into it...
*** Bug 54775 has been marked as a duplicate of this bug. ***
Can this be tested with https://gerrit.wikimedia.org/r/104510 please ?
*** Bug 62095 has been marked as a duplicate of this bug. ***