Skip to content

Commit cde5405

Browse files
committed
app:disablectrlshiftarrows and app:disablectrlshiftdisplay
1 parent 5ccf06c commit cde5405

7 files changed

Lines changed: 41 additions & 6 deletions

File tree

docs/docs/config.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ wsh editconfig
4141
| app:ctrlvpaste | bool | On Windows/Linux, when null (default) uses Control+V on Windows only. Set to true to force Control+V on all non-macOS platforms, false to disable the accelerator. macOS always uses Command+V regardless of this setting |
4242
| app:confirmquit <VersionBadge version="v0.14" /> | bool | Set to false to disable the quit confirmation dialog when closing Wave Terminal (defaults to true, requires app restart) |
4343
| app:hideaibutton <VersionBadge version="v0.14" /> | bool | Set to true to hide the AI button in the tab bar (defaults to false) |
44+
| app:disablectrlshiftarrows <VersionBadge version="v0.14" /> | bool | Set to true to disable Ctrl+Shift+Arrow keybindings for block navigation (defaults to false) |
45+
| app:disablectrlshiftdisplay <VersionBadge version="v0.14" /> | bool | Set to true to disable the Ctrl+Shift visual indicator display (defaults to false) |
4446
| ai:preset | string | the default AI preset to use |
4547
| ai:baseurl | string | Set the AI Base Url (must be OpenAI compatible) |
4648
| ai:apitoken | string | your AI api token |

frontend/app/store/keymodel.ts

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,15 @@ function getSimpleControlShiftAtom() {
7676

7777
function setControlShift() {
7878
globalStore.set(simpleControlShiftAtom, true);
79-
setTimeout(() => {
80-
const simpleState = globalStore.get(simpleControlShiftAtom);
81-
if (simpleState) {
82-
globalStore.set(atoms.controlShiftDelayAtom, true);
83-
}
84-
}, 400);
79+
const disableDisplay = globalStore.get(getSettingsKeyAtom("app:disablectrlshiftdisplay"));
80+
if (!disableDisplay) {
81+
setTimeout(() => {
82+
const simpleState = globalStore.get(simpleControlShiftAtom);
83+
if (simpleState) {
84+
globalStore.set(atoms.controlShiftDelayAtom, true);
85+
}
86+
}, 400);
87+
}
8588
}
8689

8790
function unsetControlShift() {
@@ -528,18 +531,34 @@ function registerGlobalKeys() {
528531
return true;
529532
});
530533
globalKeyMap.set("Ctrl:Shift:ArrowUp", () => {
534+
const disableCtrlShiftArrows = globalStore.get(getSettingsKeyAtom("app:disablectrlshiftarrows"));
535+
if (disableCtrlShiftArrows) {
536+
return false;
537+
}
531538
switchBlockInDirection(NavigateDirection.Up);
532539
return true;
533540
});
534541
globalKeyMap.set("Ctrl:Shift:ArrowDown", () => {
542+
const disableCtrlShiftArrows = globalStore.get(getSettingsKeyAtom("app:disablectrlshiftarrows"));
543+
if (disableCtrlShiftArrows) {
544+
return false;
545+
}
535546
switchBlockInDirection(NavigateDirection.Down);
536547
return true;
537548
});
538549
globalKeyMap.set("Ctrl:Shift:ArrowLeft", () => {
550+
const disableCtrlShiftArrows = globalStore.get(getSettingsKeyAtom("app:disablectrlshiftarrows"));
551+
if (disableCtrlShiftArrows) {
552+
return false;
553+
}
539554
switchBlockInDirection(NavigateDirection.Left);
540555
return true;
541556
});
542557
globalKeyMap.set("Ctrl:Shift:ArrowRight", () => {
558+
const disableCtrlShiftArrows = globalStore.get(getSettingsKeyAtom("app:disablectrlshiftarrows"));
559+
if (disableCtrlShiftArrows) {
560+
return false;
561+
}
543562
switchBlockInDirection(NavigateDirection.Right);
544563
return true;
545564
});

frontend/types/gotypes.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,8 @@ declare global {
12381238
"app:ctrlvpaste"?: boolean;
12391239
"app:confirmquit"?: boolean;
12401240
"app:hideaibutton"?: boolean;
1241+
"app:disablectrlshiftarrows"?: boolean;
1242+
"app:disablectrlshiftdisplay"?: boolean;
12411243
"feature:waveappbuilder"?: boolean;
12421244
"ai:*"?: boolean;
12431245
"ai:preset"?: string;

pkg/wconfig/defaultconfig/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"app:defaultnewblock": "term",
77
"app:confirmquit": true,
88
"app:hideaibutton": false,
9+
"app:disablectrlshiftarrows": false,
10+
"app:disablectrlshiftdisplay": false,
911
"autoupdate:enabled": true,
1012
"autoupdate:installonquit": true,
1113
"autoupdate:intervalms": 3600000,

pkg/wconfig/metaconsts.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ const (
1414
ConfigKey_AppCtrlVPaste = "app:ctrlvpaste"
1515
ConfigKey_AppConfirmQuit = "app:confirmquit"
1616
ConfigKey_AppHideAiButton = "app:hideaibutton"
17+
ConfigKey_AppDisableCtrlShiftArrows = "app:disablectrlshiftarrows"
18+
ConfigKey_AppDisableCtrlShiftDisplay = "app:disablectrlshiftdisplay"
1719

1820
ConfigKey_FeatureWaveAppBuilder = "feature:waveappbuilder"
1921

pkg/wconfig/settingsconfig.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ type SettingsType struct {
6161
AppCtrlVPaste *bool `json:"app:ctrlvpaste,omitempty"`
6262
AppConfirmQuit *bool `json:"app:confirmquit,omitempty"`
6363
AppHideAiButton bool `json:"app:hideaibutton,omitempty"`
64+
AppDisableCtrlShiftArrows bool `json:"app:disablectrlshiftarrows,omitempty"`
65+
AppDisableCtrlShiftDisplay bool `json:"app:disablectrlshiftdisplay,omitempty"`
6466

6567
FeatureWaveAppBuilder bool `json:"feature:waveappbuilder,omitempty"`
6668

schema/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
"app:hideaibutton": {
3030
"type": "boolean"
3131
},
32+
"app:disablectrlshiftarrows": {
33+
"type": "boolean"
34+
},
35+
"app:disablectrlshiftdisplay": {
36+
"type": "boolean"
37+
},
3238
"feature:waveappbuilder": {
3339
"type": "boolean"
3440
},

0 commit comments

Comments
 (0)