File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { focusWords } from "../test/test-ui";
1010import * as TestLogic from "../test/test-logic" ;
1111import { navigate } from "../controllers/route-controller" ;
1212import { isInputElementFocused } from "../input/input-element" ;
13+ import * as ManualRestart from "../test/manual-restart-tracker" ;
1314
1415document . addEventListener ( "keydown" , ( e ) => {
1516 if ( PageTransition . get ( ) ) return ;
@@ -74,6 +75,9 @@ document.addEventListener("keydown", (e) => {
7475 ) {
7576 e . preventDefault ( ) ;
7677 if ( ActivePage . get ( ) === "test" ) {
78+ if ( e . shiftKey ) {
79+ ManualRestart . set ( ) ;
80+ }
7781 TestLogic . restart ( ) ;
7882 } else {
7983 void navigate ( "" ) ;
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import * as Notifications from "../../elements/notifications";
1111import * as KeyConverter from "../../utils/key-converter" ;
1212import * as ShiftTracker from "../../test/shift-tracker" ;
1313import * as CompositionState from "../../states/composition" ;
14+ import * as ManualRestart from "../../test/manual-restart-tracker" ;
1415import { canQuickRestart } from "../../utils/quick-restart" ;
1516import * as CustomText from "../../test/custom-text" ;
1617import * as CustomTextState from "../../states/custom-text-name" ;
@@ -28,6 +29,9 @@ export async function handleTab(e: KeyboardEvent, now: number): Promise<void> {
2829 if ( Config . quickRestart === "tab" ) {
2930 e . preventDefault ( ) ;
3031 if ( ( TestWords . hasTab && e . shiftKey ) || ! TestWords . hasTab ) {
32+ if ( e . shiftKey ) {
33+ ManualRestart . set ( ) ;
34+ }
3135 TestLogic . restart ( ) ;
3236 return ;
3337 }
@@ -81,6 +85,9 @@ export async function handleEnter(
8185 if ( Config . quickRestart === "enter" ) {
8286 e . preventDefault ( ) ;
8387 if ( ( TestWords . hasNewline && e . shiftKey ) || ! TestWords . hasNewline ) {
88+ if ( e . shiftKey ) {
89+ ManualRestart . set ( ) ;
90+ }
8491 TestLogic . restart ( ) ;
8592 return ;
8693 }
@@ -206,6 +213,11 @@ export async function onKeydown(event: KeyboardEvent): Promise<void> {
206213
207214 if ( event . key === "Escape" && Config . quickRestart === "esc" ) {
208215 event . preventDefault ( ) ;
216+
217+ if ( event . shiftKey ) {
218+ ManualRestart . set ( ) ;
219+ }
220+
209221 TestLogic . restart ( ) ;
210222 return ;
211223 }
You can’t perform that action at this time.
0 commit comments