优化删除键上滑手势的清空逻辑,增加对编辑状态的判断,确保在有拼音输入时仅丢弃当前输入,而非清空全部内容。

This commit is contained in:
BetterAndBetterII 2025-09-20 16:04:31 +00:00
parent a88fa54ed8
commit d8bd43df5e

View File

@ -164,7 +164,13 @@ class CommonKeyActionListener :
}
is ClearAllAction -> {
backspaceSwipeState = Stopped
service.clearEditorText()
if (preeditState.isEmpty) {
// No composing/preedit: clear entire editor content
service.clearEditorText()
} else {
// Composing present (e.g., pinyin in-progress): discard composition only
service.postFcitxJob { reset() }
}
}
is PickerSwitchAction -> {
// update lastSymbolType only when specified explicitly