4
9
Fork
You've already forked libchewing
3

editor: cycle phrase candidates with Space #844

Open
noixdarec wants to merge 1 commit from noixdarec/libchewing:contribution/space-candidate-cycle into master
pull from: noixdarec/libchewing:contribution/space-candidate-cycle
merge into: chewing:master
chewing:master
chewing:release/0.13.x
chewing:push-qlrtqulwmpmp
chewing:push-wtuvoynpwosl
chewing:release/0.10.x
chewing:release/0.8.x
chewing:optimize-conversion
chewing:refactor-trie-loader
First-time contributor
Copy link

在啟用空白鍵選字時,例如為「新酷音」選詞,前三次按空白鍵直接輪換詞語候選;第四次才開啟候選窗。已輪換過的候選會排到後面。

背景:這個行為參考自早期 Windows 95 時代的「漢音輸入法」使用習慣。
此功能由使用者提出需求,並與 OpenAI Codex 協作設計、實作與測試。

在啟用空白鍵選字時,例如為「新酷音」選詞,前三次按空白鍵直接輪換詞語候選;第四次才開啟候選窗。已輪換過的候選會排到後面。 背景:這個行為參考自早期 Windows 95 時代的「漢音輸入法」使用習慣。 此功能由使用者提出需求,並與 OpenAI Codex 協作設計、實作與測試。
editor: cycle phrase candidates with Space
Some checks failed
CI / Coverage preset=rust-coverage (pull_request) Has been skipped
authenticate-commits / authenticate-commits (pull_request) Failing after 27s
CI / Aarch64 cross-compile smoke test (pull_request) Successful in 48s
CI / fedora-latest, preset=rust-release (pull_request) Failing after 2m53s
CI / Final Results (pull_request) Failing after 3s
1238e52acd
kanru left a comment
Copy link

感謝提供建議。

這個 PR 還需要更多的修改,主要是跟 Selecting 相關的狀態應該可以直接維護在 Selecting 狀態機裡面,不需要直接放在 Editor。

另外既有的關於空白鍵選字的測試失敗了,為了避免改變既有行為,請加上新的 EditorOptions 控制這個行為,讓使用者可以選用。

感謝提供建議。 這個 PR 還需要更多的修改,主要是跟 Selecting 相關的狀態應該可以直接維護在 Selecting 狀態機裡面,不需要直接放在 Editor。 另外既有的關於空白鍵選字的測試失敗了,為了避免改變既有行為,請加上新的 EditorOptions 控制這個行為,讓使用者可以選用。
@ -614,0 +636,4 @@
pub(crate)fn order_space_cycle_candidates(
&self,
begin: usize,
end: usize,
Owner
Copy link

看不太懂 order_space_cycle_candidates() 的用意是什麼,是把已經 space cycle 看過的後選詞排序到最後面嗎?

這樣會破壞選單的排序不變性。我覺得這個部份可以省略,繼續讓選單維持原本的順序就可以了。

看不太懂 `order_space_cycle_candidates()` 的用意是什麼,是把已經 space cycle 看過的後選詞排序到最後面嗎? 這樣會破壞選單的排序不變性。我覺得這個部份可以省略,繼續讓選單維持原本的順序就可以了。
@ -866,0 +986,4 @@
&&!key_event.is_state_on(KeyState::Control)
&&!key_event.is_state_on(KeyState::Shift));
if!preserve_space_cycle{
self.shared.clear_space_cycle();
Owner
Copy link

跟 Selecting 有關的狀態維護應該放在 Selecting::next() 裡面處理,這樣就不用區分是否 was_selecting

跟 Selecting 有關的狀態維護應該放在 `Selecting::next()` 裡面處理,這樣就不用區分是否 `was_selecting`
@ -889,1 +1014,4 @@
}
ifwas_selecting&&!self.is_selecting(){
self.shared.clear_space_cycle();
}
Owner
Copy link

這個狀態的維護應該要放在從 Selecting 轉換到 Entering 的 Selecting::start_entering 這個 method 裡面

這個狀態的維護應該要放在從 Selecting 轉換到 Entering 的 `Selecting::start_entering` 這個 method 裡面
@ -226,0 +227,4 @@
self.begin,
self.end,
self.base_candidates(editor,dict),
)
Owner
Copy link

這個感覺很奇怪,PhraseSelector 不應該使用 Editor 來維護 candidates list

這個感覺很奇怪,`PhraseSelector` 不應該使用 `Editor` 來維護 candidates list
Some checks failed
CI / Coverage preset=rust-coverage (pull_request) Has been skipped
authenticate-commits / authenticate-commits (pull_request) Failing after 27s
CI / Aarch64 cross-compile smoke test (pull_request) Successful in 48s
CI / fedora-latest, preset=rust-release (pull_request) Failing after 2m53s
CI / Final Results (pull_request) Failing after 3s
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u contribution/space-candidate-cycle:noixdarec-contribution/space-candidate-cycle
git switch noixdarec-contribution/space-candidate-cycle

Merge

Merge the changes and update on Forgejo.
git switch master
git merge --no-ff noixdarec-contribution/space-candidate-cycle
git switch noixdarec-contribution/space-candidate-cycle
git rebase master
git switch master
git merge --ff-only noixdarec-contribution/space-candidate-cycle
git switch noixdarec-contribution/space-candidate-cycle
git rebase master
git switch master
git merge --no-ff noixdarec-contribution/space-candidate-cycle
git switch master
git merge --squash noixdarec-contribution/space-candidate-cycle
git switch master
git merge --ff-only noixdarec-contribution/space-candidate-cycle
git switch master
git merge noixdarec-contribution/space-candidate-cycle
git push origin master
Sign in to join this conversation.
No reviewers
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
2 participants
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!844
Reference in a new issue
chewing/libchewing
No description provided.
Delete branch "noixdarec/libchewing:contribution/space-candidate-cycle"

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?