Skip to content

Commit

Permalink
Fixes the issue on committing letters.
Browse files Browse the repository at this point in the history
  • Loading branch information
zonble committed Feb 28, 2024
1 parent 809ce7e commit 764408e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/McBopomofo/KeyHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ export class KeyHandler {

// Jump into the menu to select features
if (simpleAscii === "\\") {
stateCallback(new Empty());
this.reset();
stateCallback(
new SelectingFeature((input) => {
Expand Down Expand Up @@ -505,11 +506,10 @@ export class KeyHandler {
// First, commit what's already in the composing buffer.
let inputtingState = this.buildInputtingState();
// Steal the composingBuffer built by the inputting state.
let committingState = new Committing(inputtingState.composingBuffer);
let committingState = new Committing(
inputtingState.composingBuffer + chrStr
);
stateCallback(committingState);

// Then we commit that single character.
stateCallback(new Committing(chrStr));
this.reset();
}
return true;
Expand Down
5 changes: 4 additions & 1 deletion src/pime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,11 @@ class PimeMcBopomofo {
};
},
commitString(text: string) {
console.log("commitString: " + text);
let joinedCommitString = instance.uiState.compositionString + text;
console.log("joinedCommitString: " + joinedCommitString);
instance.uiState = {
commitString: instance.uiState.compositionString + text,
commitString: joinedCommitString,
compositionString: "",
compositionCursor: 0,
showCandidates: false,
Expand Down

0 comments on commit 764408e

Please sign in to comment.