[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: testing input methods / empty MInputContext::preedit
From: |
K. Handa |
Subject: |
Re: testing input methods / empty MInputContext::preedit |
Date: |
Mon, 02 Jun 2025 08:03:48 +0900 |
Hi,
> I'm trying to write a simple program for testing input methods[0].
Thank you! Such a program is very helpful.
> In some cases when the preedit is the same between two calls to
> minput_filter, it seems that ic->preedit is empty despite both
> ibus-typing-booster and ibus-m17n showing the unchanged preedit in
> those cases.
> https://github.com/ibus/ibus-m17n/blob/182205478c8127a057c0686fb3169c3b6f19b5d4/src/engine.c#L556-L559
> has a comment "Do not update the preedit if it has length 0 to avoid
> flicker" and
> https://github.com/ibus/ibus-m17n/blob/182205478c8127a057c0686fb3169c3b6f19b5d4/src/engine.c#L732
> calls ibus_m17n_engine_hide_preedit_if_empty in some cases while
> handling keys.
> Is that the right way to get the preedit from m17n, to ignore it when
> it's empty most of the time, but clear it in specific circumstances when
> handling keys?
I don't think so, but m17n-lib may have a bug of setting ic->preedit
unnecessary. Did you find such a situation by your test program?
> If I can get this test program working, would upstreaming it be
> possible?
Yes, of course.
> It would be nice to have some way to test input methods out of
> the box. Here's how it works:
> $ ./m17n-test -l t -n rfc1345 -i a
> committed does not match. Expected '', got 'a'.
> $ ./m17n-test -l t -n rfc1345 -i a -t a
> $ ./m17n-test -l t -n rfc1345 -i '&'
> preedit does not match. Expected '', got '&'.
> $ ./m17n-test -l t -n rfc1345 -i '&' -p '&'
> $ ./m17n-test -l t -n rfc1345 -i '&' -i a -i "'"
> committed does not match. Expected '', got 'á'.
> $ ./m17n-test -l t -n rfc1345 -i '&' -i a -i "'" -t á
It would be nice that one can write a recipe file something like this
(not a well-conceived idea):
--im:t-rfc1345--
a a
& [&]
a [&a]
i á
-----------------
By the way, do you know about the environment variable MDEBUG_INPUT and
the test program m17n-edit? I had tested input methods with them long
ago.
Regards,
K. Handa
- Re: testing input methods / empty MInputContext::preedit,
K. Handa <=
- Re: testing input methods / empty MInputContext::preedit, David Mandelberg, 2025/06/01
- Re: testing input methods / empty MInputContext::preedit, K. Handa, 2025/06/02
- Re: testing input methods / empty MInputContext::preedit, David Mandelberg, 2025/06/02
- Re: testing input methods / empty MInputContext::preedit, K. Handa, 2025/06/02
- Re: testing input methods / empty MInputContext::preedit, David Mandelberg, 2025/06/02
- Re: testing input methods / empty MInputContext::preedit, K. Handa, 2025/06/03
- Re: testing input methods / empty MInputContext::preedit, David Mandelberg, 2025/06/03
- Re: testing input methods / empty MInputContext::preedit, David Mandelberg, 2025/06/06
- Re: testing input methods / empty MInputContext::preedit, Mike FABIAN, 2025/06/03
- Re: testing input methods / empty MInputContext::preedit, K. Handa, 2025/06/04