Skip to content

Commit 0c60f2c

Browse files
authored
set Ctrl+V as a paste accelerator by default on windows (#2640)
1 parent 0d60950 commit 0c60f2c

File tree

7 files changed

+26
-6
lines changed

7 files changed

+26
-6
lines changed

docs/docs/config.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ wsh editconfig
3737
| app:dismissarchitecturewarning | bool | Disable warnings on app start when you are using a non-native architecture for Wave. For more info, see [Why does Wave warn me about ARM64 translation when it launches?](./faq#why-does-wave-warn-me-about-arm64-translation-when-it-launches). |
3838
| app:defaultnewblock | string | Sets the default new block (Cmd:n, Cmd:d). "term" for terminal block, "launcher" for launcher block (default = "term") |
3939
| app:showoverlayblocknums | bool | Set to false to disable the Ctrl+Shift block number overlay that appears when holding Ctrl+Shift (defaults to true) |
40+
| 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 |
4041
| ai:preset | string | the default AI preset to use |
4142
| ai:baseurl | string | Set the AI Base Url (must be OpenAI compatible) |
4243
| ai:apitoken | string | your AI api token |

emain/emain-menu.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,20 @@ async function getWorkspaceMenu(ww?: WaveBrowserWindow): Promise<Electron.MenuIt
7373
return workspaceMenu;
7474
}
7575

76-
function makeEditMenu(): Electron.MenuItemConstructorOptions[] {
76+
function makeEditMenu(fullConfig?: FullConfigType): Electron.MenuItemConstructorOptions[] {
77+
let pasteAccelerator: string;
78+
if (unamePlatform === "darwin") {
79+
pasteAccelerator = "Command+V";
80+
} else {
81+
const ctrlVPaste = fullConfig?.settings?.["app:ctrlvpaste"];
82+
if (ctrlVPaste == null) {
83+
pasteAccelerator = unamePlatform === "win32" ? "Control+V" : "";
84+
} else if (ctrlVPaste) {
85+
pasteAccelerator = "Control+V";
86+
} else {
87+
pasteAccelerator = "";
88+
}
89+
}
7790
return [
7891
{
7992
role: "undo",
@@ -94,7 +107,7 @@ function makeEditMenu(): Electron.MenuItemConstructorOptions[] {
94107
},
95108
{
96109
role: "paste",
97-
accelerator: unamePlatform === "darwin" ? "Command+V" : "",
110+
accelerator: pasteAccelerator,
98111
},
99112
{
100113
role: "pasteAndMatchStyle",
@@ -312,7 +325,6 @@ async function makeFullAppMenu(callbacks: AppMenuCallbacks, workspaceOrBuilderId
312325
const numWaveWindows = getAllWaveWindows().length;
313326
const webContents = workspaceOrBuilderId && getWebContentsByWorkspaceOrBuilderId(workspaceOrBuilderId);
314327
const appMenuItems = makeAppMenuItems(webContents);
315-
const editMenu = makeEditMenu();
316328

317329
const isBuilderWindowFocused = focusedBuilderWindow != null;
318330
let fullscreenOnLaunch = false;
@@ -323,6 +335,7 @@ async function makeFullAppMenu(callbacks: AppMenuCallbacks, workspaceOrBuilderId
323335
} catch (e) {
324336
console.error("Error fetching config:", e);
325337
}
338+
const editMenu = makeEditMenu(fullConfig);
326339
const fileMenu = makeFileMenu(numWaveWindows, callbacks, fullConfig);
327340
const viewMenu = makeViewMenu(webContents, callbacks, isBuilderWindowFocused, fullscreenOnLaunch);
328341
let workspaceMenu: Electron.MenuItemConstructorOptions[] = null;

frontend/types/gotypes.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ declare global {
2424
"ai:model"?: string;
2525
"ai:thinkinglevel"?: string;
2626
"ai:endpoint"?: string;
27-
"ai:apiversion"?: string;
27+
"ai:azureapiversion"?: string;
2828
"ai:apitoken"?: string;
2929
"ai:apitokensecretname"?: string;
3030
"ai:azureresourcename"?: string;
@@ -1051,6 +1051,7 @@ declare global {
10511051
"app:dismissarchitecturewarning"?: boolean;
10521052
"app:defaultnewblock"?: string;
10531053
"app:showoverlayblocknums"?: boolean;
1054+
"app:ctrlvpaste"?: boolean;
10541055
"feature:waveappbuilder"?: boolean;
10551056
"ai:*"?: boolean;
10561057
"ai:preset"?: string;

pkg/wconfig/metaconsts.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const (
1111
ConfigKey_AppDismissArchitectureWarning = "app:dismissarchitecturewarning"
1212
ConfigKey_AppDefaultNewBlock = "app:defaultnewblock"
1313
ConfigKey_AppShowOverlayBlockNums = "app:showoverlayblocknums"
14+
ConfigKey_AppCtrlVPaste = "app:ctrlvpaste"
1415

1516
ConfigKey_FeatureWaveAppBuilder = "feature:waveappbuilder"
1617

pkg/wconfig/settingsconfig.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ type SettingsType struct {
5858
AppDismissArchitectureWarning bool `json:"app:dismissarchitecturewarning,omitempty"`
5959
AppDefaultNewBlock string `json:"app:defaultnewblock,omitempty"`
6060
AppShowOverlayBlockNums *bool `json:"app:showoverlayblocknums,omitempty"`
61+
AppCtrlVPaste *bool `json:"app:ctrlvpaste,omitempty"`
6162

6263
FeatureWaveAppBuilder bool `json:"feature:waveappbuilder,omitempty"`
6364

schema/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
"app:showoverlayblocknums": {
2121
"type": "boolean"
2222
},
23+
"app:ctrlvpaste": {
24+
"type": "boolean"
25+
},
2326
"feature:waveappbuilder": {
2427
"type": "boolean"
2528
},

schema/waveai.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"ai:apitype": {
3131
"type": "string",
3232
"enum": [
33-
"anthropic-messages",
33+
"google-gemini",
3434
"openai-responses",
3535
"openai-chat"
3636
]
@@ -49,7 +49,7 @@
4949
"ai:endpoint": {
5050
"type": "string"
5151
},
52-
"ai:apiversion": {
52+
"ai:azureapiversion": {
5353
"type": "string"
5454
},
5555
"ai:apitoken": {

0 commit comments

Comments
 (0)