Repository navigation
refactor(coordinator): 移除未启用的旧版按音节左移分支 - #384
Merged
huanfeng merged 2 commits intoNov 24, 2026
Merged
Conversation
本refactor为衔接此前的huanfeng#363 pr,在我正式加入「按光标位置检索候选」前的代码清理。注意到在旧版逻辑中,cursor_by_syllable()同时承担了本refactor打算删除的旧版编码区光标移动逻辑,与后续真正用于是否执行update_candidates()的判定的逻辑。同时根据#363的讨论,现在这种rime类的左右光标移动方式已经是我们期望的实现方式。 本轮删除的旧逻辑在光标位于音节中间时的动作为跳到音节起点,并且两端不回绕。该分支只在 cursor_by_syllable() 返回 true 时才会执行,新版仓库内也没有任何地方调用 set_cursor_by_syllable,因此默认配置下这段逻辑不会执行,综上该分支已经事实废弃,保留旧分支容易让后续接入产生误判。 本次删除该分支,以及它唯一的辅助函数 syllable_left 和对应的测试,同时重写了该部分的注释。 修改前后输入法在默认配置下的行为不变。
Owner
|
感谢贡献,已 squash 合入 main(13d09850)。 核对过:仓内(含 Android 等兄弟仓)确实没有 一个小提示: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明
本 PR 是为「按光标位置检索候选」做的前置清理,衔接 #363 。
注意到在旧版逻辑中,
cursor_by_syllable()同时控制两个不同层面的行为:query_cut据此决定按光标截断查询,if moved据此决定移动后是否调用update_candidates()。第二项是同一件事的两个环节,放在一个开关里是合理的;问题在于第一项与它们无关。同时注意到0.133中且已经事实上没有任何地方调用 set_cursor_by_syllable,因此旧分支在当前代码里已经不可达;同时根据#363的讨论,我们已经打算切换到这种rime类的左右光标移动方式。综上该分支已经事实废弃,保留旧分支容易让后续接入产生误判和让cursor_by_syllable变量含义不清。
本次删除该分支,以及它唯一的辅助函数 syllable_left 和对应的测试,同时重写了该部分的注释。按照之前的建议,一个PR只做一件事,所以单独为这个清理开一个PR。
修改前后输入法在默认配置下的行为不变。
变更类型
相关 Issue
feat(coordinator): 支持按光标分段选词与音节跳转 #363
测试情况
.\scripts\dev.ps1 ci通过(fmt 检查 + clippy + 测试)检查清单
cargo fmt格式化(逻辑修改与 fmt 修改分开提交)AGENTS.md