Distinguish Pending Text from Committed Text

2009-05-19 Thread Dong Feng
When using an non-English input method, such as Japanese or Chinese, the entered characters are first in a pending status (i.e. with an underscore). Pressing the space key make those pending text converted to the actual non-English characters. Pressing the Enter key make the underscore beneath the

Re: Distinguish Pending Text from Committed Text

2009-05-19 Thread Michael Ash
On Tue, May 19, 2009 at 9:48 AM, Dong Feng middle.fengd...@gmail.com wrote: When using an non-English input method, such as Japanese or Chinese, the entered characters are first in a pending status (i.e. with an underscore). Pressing the space key make those pending text converted to the

Re: Distinguish Pending Text from Committed Text

2009-05-19 Thread Gideon King
You can use the markedRange method and then remove it from the text range you are dealing with to get only the committed text. Gideon On Tue, May 19, 2009 at 9:48 AM, Dong Feng middle.fengd...@gmail.com wrote: When using an non-English input method, such as Japanese or Chinese, the

Re: Distinguish Pending Text from Committed Text

2009-05-19 Thread Dong Feng
Thanks Michael and Gideon's reply. [NSTextInput markedRange] works. A minor question is that [NSWindow fieldEditor] returns an NSText*, rather than an NSTextView*. I think that's because of historical reason and it should be safe to always cast a returned NSText point to an NSTextView. Is it

Re: Distinguish Pending Text from Committed Text

2009-05-19 Thread Gwynne Raskind
On May 19, 2009, at 10:35 PM, Dong Feng wrote: Thanks Michael and Gideon's reply. [NSTextInput markedRange] works. A minor question is that [NSWindow fieldEditor] returns an NSText*, rather than an NSTextView*. I think that's because of historical reason and it should be safe to always cast a