File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed
Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { getActivePage } from "../../states/core";
66import { hotkeys , quickRestartHotkeyMap } from "../../states/hotkeys" ;
77import { createHotkey } from "./utils" ;
88import { getConfig } from "../../config/store" ;
9- import { isLongTest } from "../../states/test" ;
9+ import { isLongTest , wordsHaveNewline , wordsHaveTab } from "../../states/test" ;
1010
1111function quickRestart ( e : KeyboardEvent ) : void {
1212 if ( isAnyPopupVisible ( ) ) {
@@ -37,5 +37,10 @@ createHotkey(
3737createHotkey (
3838 ( ) => quickRestartHotkeyMap [ getConfig . quickRestart ] ,
3939 quickRestart ,
40- ( ) => ( { enabled : isLongTest ( ) } ) ,
40+ ( ) => ( {
41+ enabled :
42+ isLongTest ( ) &&
43+ ! ( wordsHaveTab ( ) && getConfig . quickRestart === "tab" ) &&
44+ ! ( wordsHaveNewline ( ) && getConfig . quickRestart === "enter" ) ,
45+ } ) ,
4146) ;
Original file line number Diff line number Diff line change @@ -28,14 +28,26 @@ createEffect(() => {
2828
2929function updateHotkeys ( ) : Hotkeys {
3030 const isOnTestPage = getActivePage ( ) === "test" ;
31+
32+ const quickRestartIsTab = getConfig . quickRestart === "tab" ;
33+ const quickRestartIsEnter = getConfig . quickRestart === "enter" ;
34+ // const quickRestartIsEsc = getConfig.quickRestart === "esc";
35+
36+ const commandlineIsTab = getConfig . quickRestart === "esc" ;
37+ // const commandlineIsEsc = getConfig.quickRestart !== "esc";
38+
3139 return {
3240 quickRestart : shiftHotkey (
3341 quickRestartHotkeyMap [ getConfig . quickRestart ] ,
34- isOnTestPage && ( wordsHaveTab ( ) || isLongTest ( ) ) ,
42+ isOnTestPage &&
43+ ( ( wordsHaveTab ( ) && quickRestartIsTab ) ||
44+ ( ( wordsHaveNewline ( ) || getConfig . funbox . includes ( "58008" ) ) &&
45+ quickRestartIsEnter ) ||
46+ isLongTest ( ) ) ,
3547 ) ,
3648 commandline : shiftHotkey (
37- getConfig . quickRestart === "esc" ? "Tab" : "Escape" ,
38- isOnTestPage && wordsHaveNewline ( ) ,
49+ commandlineIsTab ? "Tab" : "Escape" ,
50+ isOnTestPage && wordsHaveTab ( ) && commandlineIsTab ,
3951 ) ,
4052 } ;
4153}
You can’t perform that action at this time.
0 commit comments