Skip to content

Commit f7220a5

Browse files
authored
Update test.html
1 parent e58bbde commit f7220a5

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

test.html

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -955,12 +955,22 @@ <h2>輸入法模式:</h2>
955955
const code = result.code;
956956
const index = result.index;
957957
let suffix = '';
958-
if (index < 9) {
959-
suffix = (index + 1).toString();
960-
} else if (index === 9) {
961-
suffix = '0';
962-
} else {
963-
suffix = '>';
958+
const candidatesForCode = currentCodemap[code];
959+
// 只有當該編碼有多個候選字時才加上後綴
960+
if (candidatesForCode && candidatesForCode.length > 1) {
961+
if (index === 0) {
962+
// 第一個字不顯示數字
963+
suffix = '';
964+
} else if (index < 9) {
965+
// 第二個到第九個顯示數字
966+
suffix = (index + 1).toString();
967+
} else if (index === 9) {
968+
// 第十個顯示全形零
969+
suffix = '0';
970+
} else {
971+
// 第十一個之後顯示大於符號
972+
suffix = '>';
973+
}
964974
}
965975
return formatCode(code) + suffix;
966976
});

0 commit comments

Comments
 (0)