rime / ibus-rime

【中州韻】Rime for Linux/IBus
https://rime.im
GNU General Public License v3.0
734 stars 105 forks source link

on-the-spot input style is not supported #1

Closed Jiehong closed 12 years ago

Jiehong commented 12 years ago

Currently, ibus-rime only supports over-the-spot input style.

If we set the preference of ibus to insert the current input text in the editing frame, ibus-rime doesn't do it, whereas ibus-pinyin does.

lotem commented 12 years ago

That would be a little repetitive, given converted text already shown on the panel, but sounds reasonable if used in a search box with auto-completion.

Jiehong commented 12 years ago

Of course, it would be great if the user can chose. I personally prefer the over-the-spot way, but in some cases, such as search engine, it would help. Besides, only on-the-spot mode is supported when writing in Emacs, which annoys me more.

If it doesn't need too much work, it would be great.

lotem commented 12 years ago

Just recalled, I did some test on this last year... After implementing this feature I come to the same conclusion: although preedit text could be shown visually "inline", it doesn't have any effect on auto-completion-enabled search boxes until finally it is confirmed. Hmm, it really is nothing but a matter of taste.

lotem commented 12 years ago

So, i've decided it should be like this: zhong guo| [1.中國] but not stupidly this: 中國| [zhong guo>] [1.中國 ] but there is a problem with inlining preedit text: text attributes such as colors, underline,... are not fully supported in certain applications (eg. firefox).

Jiehong commented 12 years ago

I'm not certain we are speaking about exactly the same thing.

The inline mode of ibus is almost the over-the-spot mode. In over the stop mode, Chinese characters only appears at the cursor position when we validate them.

In the "insert the current text in the application window" mode, or inline mode, it's almost like over the spot: Candidates are presented the same, in the same window, with their own colors if needed… The only difference is that the first candidate is also displayed at the cursor position in the application window.

To have a better idea, try with ibus-pinyin. You'll see the difference.

Therefore, there is no need to worry about how you should present things again, it's the same. The only difference is that the first candidate and what's you're writing is at the cursor position too.

lotem commented 12 years ago

OK. Almost there. Ignore my previous post. Several changes have been made to ibus-rime:

  1. If ibus config option "general/embed_preedit_text" (== insert the current text in the application window) is not set, nothing changes;
  2. otherwise, place a line of "composed" text at cursor position -- this is not exactly the first candidate; when you have confirmed a first part of the sentence, you see candidates for the remaining part, and inline text for the whole sentence.
  3. underline and colors :-)
  4. (TODO) occasionally, the input string is repeated 3 times... so it's better get rid of the "echoing" candidate.
Jiehong commented 12 years ago

Sounds great!