Skip to content

fix: end composition only when toggling ascii_mode#2002

Merged
Bambooin merged 1 commit into
osfans:developfrom
ENOA-REIAH-UION:develop
May 8, 2026
Merged

fix: end composition only when toggling ascii_mode#2002
Bambooin merged 1 commit into
osfans:developfrom
ENOA-REIAH-UION:develop

Conversation

@ENOA-REIAH-UION
Copy link
Copy Markdown
Contributor

@ENOA-REIAH-UION ENOA-REIAH-UION commented May 6, 2026

before: switching any option in Mode_Switch would end composition and commit the first candidate

after: only toggling ascii_mode ends composition and commits the raw input; switching other options no longer end composition. Keyboard switching still commits the first candidate

Pull request

Issue tracker

Fixes will automatically close the related issues

Fixes #1514
Fixes #

Feature

Describe features of this pull request

Code of conduct

Code style

Build pass

  • make debug

Manually test

  • Done

Code Review

  1. No wildcards import
  2. Manual build and test pass
  3. GitHub Action CI pass
  4. At least one contributor review and approve
  5. Merged clean without conflicts
  6. PR will be merged by rebase upstream base

Daily build

Login and download artifact at https://github.com/osfans/trime/actions

Additional Info

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts Trime’s Mode_switch behavior so that switching runtime options no longer always ends an active composition, aligning the IME behavior with the reported issue (#1514) while preserving the existing “keyboard switching commits” behavior.

Changes:

  • Stop committing composition for every Mode_switch option toggle from the keyboard action listener.
  • Add special-case handling for ascii_mode option updates: when enabling ascii_mode during composition, commit raw input and clear composition.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
app/src/main/java/com/osfans/trime/ime/keyboard/CommonKeyboardActionListener.kt Removes unconditional commitComposition() after toggling a runtime option.
app/src/main/java/com/osfans/trime/core/Rime.kt Adds ascii_mode-specific logic to commit raw input + clear composition on enable.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/main/java/com/osfans/trime/core/Rime.kt
Comment thread app/src/main/java/com/osfans/trime/core/Rime.kt
@Bambooin
Copy link
Copy Markdown
Collaborator

Bambooin commented May 7, 2026

The commit message with only end violate the grammar rule of English, and it's too long for the commit title, we can move the detail message to the commit body.

before: switching any option in Mode_Switch would end composition and commit the first candidate

after: only toggling ascii_mode ends composition and commits the raw input; switching other options no longer end composition. Keyboard switching still commits the first candidate
@ENOA-REIAH-UION ENOA-REIAH-UION changed the title fix: only end composition when toggling ascii_mode, instead of on all… fix: end composition only when toggling ascii_mode May 7, 2026
@Bambooin Bambooin merged commit 277b8ea into osfans:develop May 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mode_switch commits raw text or the first candidate

3 participants