@@ -49,6 +49,7 @@ import {
4949} from "../input/input-element" ;
5050import * as MonkeyPower from "../elements/monkey-power" ;
5151import * as SlowTimer from "../states/slow-timer" ;
52+ import * as CompositionDisplay from "../elements/composition-display" ;
5253
5354const debouncedZipfCheck = debounce ( 250 , async ( ) => {
5455 const supports = await JSONData . checkIfLanguageSupportsZipf ( Config . language ) ;
@@ -89,10 +90,9 @@ ConfigEvent.subscribe((eventKey, eventValue, nosave) => {
8990 debouncedZipfCheck ( ) ;
9091 }
9192 if ( eventKey === "fontSize" ) {
92- $ ( "#caret, #paceCaret, #liveStatsMini, #typingTest, #wordsInput" ) . css (
93- "fontSize" ,
94- ( eventValue as number ) + "rem" ,
95- ) ;
93+ $ (
94+ "#caret, #paceCaret, #liveStatsMini, #typingTest, #wordsInput, #compositionDisplay" ,
95+ ) . css ( "fontSize" , ( eventValue as number ) + "rem" ) ;
9696 if ( ! nosave ) {
9797 OutOfFocus . hide ( ) ;
9898 updateWordWrapperClasses ( ) ;
@@ -880,7 +880,7 @@ export async function updateWordLetters({
880880 let charToShow =
881881 currentWordChars [ input . length + i ] ?? compositionChar ;
882882
883- if ( Config . indicateTypos === "replace" ) {
883+ if ( Config . compositionDisplay === "replace" ) {
884884 charToShow = compositionChar === " " ? "_" : compositionChar ;
885885 }
886886
@@ -1919,6 +1919,15 @@ export function afterTestStart(): void {
19191919 TimerProgress . update ( ) ;
19201920}
19211921
1922+ export function onTestRestart ( ) : void {
1923+ if ( Config . compositionDisplay === "below" ) {
1924+ CompositionDisplay . update ( " " ) ;
1925+ CompositionDisplay . show ( ) ;
1926+ } else {
1927+ CompositionDisplay . hide ( ) ;
1928+ }
1929+ }
1930+
19221931$ ( ".pageTest #copyWordsListButton" ) . on ( "click" , async ( ) => {
19231932 let words ;
19241933 if ( Config . mode === "zen" ) {
@@ -2043,4 +2052,12 @@ ConfigEvent.subscribe((key, value) => {
20432052 if ( key === "showOutOfFocusWarning" && value === false ) {
20442053 OutOfFocus . hide ( ) ;
20452054 }
2055+ if ( key === "compositionDisplay" ) {
2056+ if ( value === "below" ) {
2057+ CompositionDisplay . update ( " " ) ;
2058+ CompositionDisplay . show ( ) ;
2059+ } else {
2060+ CompositionDisplay . hide ( ) ;
2061+ }
2062+ }
20462063} ) ;
0 commit comments