fix: Mac - shortcut for select all

This commit is contained in:
Kenta Kishikawa 2023-12-07 01:07:58 +09:00
parent aa7d91f2c5
commit f0fc50097b
3 changed files with 14 additions and 0 deletions

View File

@ -229,6 +229,9 @@ ipcMain.on('window-action', async (event, arg) => {
case 'paste':
mainWindow.webContents.paste();
break;
case 'selectAll':
mainWindow.webContents.selectAll();
break;
}
});

View File

@ -48,6 +48,7 @@ module.exports = ({ editMenu }) => [
{ command: 'edit.cut' },
{ command: 'edit.copy' },
{ command: 'edit.paste' },
{ command: 'edit.selectAll' },
],
}
: null,

View File

@ -835,6 +835,16 @@ registerCommand({
onClick: () => getElectron().send('window-action', 'paste'),
});
registerCommand({
id: 'edit.selectAll',
category: 'Edit',
name: 'Select All',
keyText: 'CtrlOrCommand+A',
systemCommand: true,
testEnabled: () => getElectron() != null,
onClick: () => getElectron().send('window-action', 'selectAll'),
});
const electron = getElectron();
if (electron) {
electron.addEventListener('run-command', (e, commandId) => runCommand(commandId));