Cocoa IME changes

34 views
Skip to first unread message

Neil Hodgson

unread,
Nov 10, 2016, 9:29:19 PM11/10/16
to Scintilla mailing list
Due to bug 1881 where malloc failures were reported for Chinese input on macOS 10.12, changes were made to the ScintillaView IME methods that should be more compliant with Apple’s documentation. These changes modified the pattern of calls substantially and may result in different IME behaviour. IME users on macOS should watch for any regressions.

They may also impact any application that calls the selectedRange method on ScintillaView or SCIContentView as this now returns { NSNotFound, 0 } for an empty selection instead of an empty range inside the document.

https://sourceforge.net/p/scintilla/bugs/1881/

Neil

Neil Hodgson

unread,
Mar 1, 2017, 5:45:52 PM3/1/17
to Scintilla mailing list
The change applied to stop memory allocation errors with Chinese input caused the accented character chooser used with European languages to not appear. This is the small window that appears when you hold down a key showing potential accented forms: hold down “o" and a choice from "ôöòóœøōõ” is shown.

To fix this, the previous change (returning NSNotFound when the selection is empty) was made conditional so that it only happens with the "Cangjie" input source. This is ugly but I haven’t found a better solution. If other input sources show similar errors then they should be reported so the condition can be expanded.

Some other selection actions may cause messages or breaks inside the Xcode debugger but should be OK when running a release build.

Change set:
https://sourceforge.net/p/scintilla/code/ci/29534cb8eafb48f9eacc574b8063e9d66520ae8a/

Also made a change that substitutes the replacement character (0xFFFD) for any invalid UTF-8 when reporting text to the IME as invalid Unicode also upsets the systems IME code:
https://sourceforge.net/p/scintilla/code/ci/b82fe8d33961050a7905d6588eef858b85ca804c/

Neil

Mike Lischke

unread,
Mar 2, 2017, 3:19:18 AM3/2/17
to scintilla...@googlegroups.com
Hi Neil,


  The change applied to stop memory allocation errors with Chinese input caused the accented character chooser used with European languages to not appear. This is the small window that appears when you hold down a key showing potential accented forms: hold down “o" and a choice from "ôöòóœøōõ” is shown.

  To fix this, the previous change (returning NSNotFound when the selection is empty) was made conditional so that it only happens with the  "Cangjie" input source. This is ugly but I haven’t found a better solution. If other input sources show similar errors then they should be reported so the condition can be expanded.


Probably related to that: I have seen some trouble with Scintilla on macOS that I haven't seen on previous OSX versions and got user reports for that. It's about the use of the backtick (grave) char which sometimes doesn't show up in Scintilla: https://www.youtube.com/watch?v=P4P58W9f_bs. It seems to depend on the selected keyboard layout whether it works or not. I myself don't see any trouble with the standard german keyboard layout: http://pasteall.org/pic/show.php?id=113044, except that I cannot create composed characters (e.g. a with grave), but thought that this has to do with my hand assembled machine here.

Have you heard anything about or seen this before?


Neil Hodgson

unread,
Mar 2, 2017, 5:43:25 PM3/2/17
to scintilla...@googlegroups.com
Mike Lischke:

> Probably related to that: I have seen some trouble with Scintilla on macOS that I haven't seen on previous OSX versions and got user reports for that. It's about the use of the backtick (grave) char which sometimes doesn't show up in Scintilla: https://www.youtube.com/watch?v=P4P58W9f_bs.

“EUA Internacional PC” is the Portuguese translation of “U.S. International PC” which can be added from the English section of Keyboard Preferences | Input Sources.
This produces dead key accents in Scintilla where the accent appears with the red underline.

There could be or have been a bug in Scintilla but its been working in SciTE. The video seems to show room being taken for the accent and that could mean its in the document but invisible because of styling or similar.

Neil

Mike Lischke

unread,
Mar 3, 2017, 3:37:52 AM3/3/17
to scintilla...@googlegroups.com
>
> “EUA Internacional PC” is the Portuguese translation of “U.S. International PC” which can be added from the English section of Keyboard Preferences | Input Sources.
> This produces dead key accents in Scintilla where the accent appears with the red underline.
>
> There could be or have been a bug in Scintilla but its been working in SciTE. The video seems to show room being taken for the accent and that could mean its in the document but invisible because of styling or similar.


Hmm, if it were styling the backtick wouldn't show up when changing the keyboard layout. I's surprising that the keyboard layout has such an influence since the keycode for backtick is the same regardless of the layout. I also tested with the English PC layout and still see the backticks, so I believe it must have to do with something on the user's machine (though, it's not only one user). Hard to do anything about it, if it's not reproducible.

Thanks,

Mike
--
www.soft-gems.net

Reply all
Reply to author
Forward
0 new messages