4
9
Fork
You've already forked libchewing
3

Return behavior is changed comparing to 0.5.1 #714

Closed
opened 2025年07月25日 22:46:11 +02:00 by wengxt · 4 comments
wengxt commented 2025年07月25日 22:46:11 +02:00 (Migrated from github.com)
Copy link

Describe the bug
When zuin is not completed, return does not commit existing string, instead,
chewing_keystroke_CheckIgnore -> false
chewing_keystroke_CheckAbsorb -> false
chewing_commit_Check -> false

To Reproduce
Key sequence: "z" "p" "space" "z" "p" "Return".

Expected behavior
I can see rust return the result as "bell", I'd assume it indicates that it's an error, which means this key should be absorb. I briefly check the capi, there's no way to check Bell.

Screenshots
Platform (please complete the following information):

  • OS: Arch
  • Desktop: N/A
  • IME: fcitx5-chewing
  • Version 0.9.1
**Describe the bug** When zuin is not completed, return does not commit existing string, instead, chewing_keystroke_CheckIgnore -> false chewing_keystroke_CheckAbsorb -> false chewing_commit_Check -> false **To Reproduce** Key sequence: "z" "p" "space" "z" "p" "Return". **Expected behavior** I can see rust return the result as "bell", I'd assume it indicates that it's an error, which means this key should be absorb. I briefly check the capi, there's no way to check Bell. **Screenshots** **Platform (please complete the following information):** - OS: Arch - Desktop: N/A - IME: fcitx5-chewing - Version 0.9.1
wengxt commented 2025年07月25日 22:50:32 +02:00 (Migrated from github.com)
Copy link

In 0.5.1, the keystrokeRtn can be sth like KEYSTROKE_ABSORB | KEYSTROKE_BELL

However, now it's a variant can't be both absorb and bell.

In 0.5.1, the keystrokeRtn can be sth like KEYSTROKE_ABSORB | KEYSTROKE_BELL However, now it's a variant can't be both absorb and bell.
kanru commented 2025年07月25日 23:24:59 +02:00 (Migrated from github.com)
Copy link

Thanks for the report!

I was pretty sure that we are returning KEYSTROKE_BELL in the API but it turns out it was only available via direct struct inspection. In our test we have

github.com/chewing/libchewing@2d4b995ba8/tests/testhelper.c (L379-L380)

So the backwards compatible behavior should be returning chewing_keystroke_CheckAbsorb=true in this case.

I can also add a new method to check Bell condition.

Thanks for the report! I was pretty sure that we are returning KEYSTROKE_BELL in the API but it turns out it was only available via direct struct inspection. In our test we have https://github.com/chewing/libchewing/blob/2d4b995ba8fab7cfc53155290da65cf04639ed47/tests/testhelper.c#L379-L380 So the backwards compatible behavior should be returning chewing_keystroke_CheckAbsorb=true in this case. I can also add a new method to check Bell condition.
wengxt commented 2025年07月25日 23:53:19 +02:00 (Migrated from github.com)
Copy link

The actual behavior is still different:

Check the video below:

https://github.com/user-attachments/assets/01786c4e-7c74-4cfd-85bf-a040ce1bfc54

with 0.5.1, the "分" is committed as returned with chewing_commit_Check, zuin is kept.
with 0.9.1, chewing_commit_Check doesn't return true.

The actual behavior is still different: Check the video below: <!-- Failed to upload "2025年07月25日 14-49-43.mp4" --> https://github.com/user-attachments/assets/01786c4e-7c74-4cfd-85bf-a040ce1bfc54 with 0.5.1, the "分" is committed as returned with chewing_commit_Check, zuin is kept. with 0.9.1, chewing_commit_Check doesn't return true.
kanru commented 2025年07月26日 00:08:33 +02:00 (Migrated from github.com)
Copy link

I see. So you mean there are two bugs here

  1. We don't return chewing_keystroke_CheckAbsorb=true when last key was an error
  2. Previously we commit the pre-edit buffer even if composition is ongoing

I think the current behavior for composition handling is more intuitive and the 0.5.1 behavior is more like a bug.

I see. So you mean there are two bugs here 1. We don't return chewing_keystroke_CheckAbsorb=true when last key was an error 2. Previously we commit the pre-edit buffer even if composition is ongoing I think the current behavior for composition handling is more intuitive and the 0.5.1 behavior is more like a bug.
Sign in to join this conversation.
No Branch/Tag specified
master
release/0.13.x
push-qlrtqulwmpmp
push-wtuvoynpwosl
release/0.10.x
release/0.8.x
optimize-conversion
refactor-trie-loader
v0.13.0
v0.12.0
v0.12.0-alpha.1
v0.11.0
v0.11.0-alpha.1
v0.10.3
v0.10.2
v0.10.1
v0.10.0
v0.9.1
v0.9.0
v0.9.0-rc.3
v0.9.0-rc.2
v0.9.0-rc.1
v0.8.5
v0.8.4
v0.8.3
v0.8.2
v0.8.1
v0.8.0
v0.8.0-rc.4
v0.8.0-rc.3
v0.8.0-rc.2
v0.8.0-rc.1
v0.7.0
v0.7.0-rc.2
v0.7.0-rc.1
v0.6.0
v0.6.0-rc.2
v0.6.0-rc.1
v0.5.1
v0.5.0
v0.4.0
v0.3.5
v0.3.4
v0.3.3
v0.3.2
v0.3.1
v0.3.0
v0.2.7
v0.2.6
v0.2.5
v0.2.4
Labels
Clear labels
dictionary
duplicate
fixed
0.11.0

Archived

fixed
0.13.0
refactoring

Archived

rewrite in rust
Might be fixed by the rust rewrite
thirdparty
arch
aarch64
系統架構是 Aarch64
arch
x86_64
系統架構是 x86_64
cannot reproduce
無法重現問題 Cannot reproduce the issue
contribution welcome
歡迎來幫忙 Contributions are very welcome, get started here
duplicate
重複的問題回報 This issue or pull request already exists
good first issue
適合新手 Interested in contributing? Get started here.
help wanted
需要高手相助 Need some help
invalid
回報的問題無效 Something is wrong
kind
bug
有東西不正常運作 Something is not working
kind
doc
加強文件說明 Enhance documentation
kind
enhancement
新功能 New feature
kind
mega issue
同一個問題回報中包含多個問題 Multiple issues reported
kind
question
只是問問題 Asking a question
needinfo
需要更多資訊 More information is needed
os
apple
作業系統是 MacOS 或 iOS
os
linux
作業系統是 GNU Linux
os
windows
作業系統是 Windows
to be determined
還未被說服有需求 Can't decide whether this is needed
upstream
跟上游軟體相關 Related to an upstream repository, already reported there
wontfix
我們決定不處理 Won't be fixed
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
chewing/libchewing#714
Reference in a new issue
chewing/libchewing
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?