mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 01:55:59 +00:00
context menu
This commit is contained in:
@@ -142,6 +142,24 @@ registerCommand({
|
||||
group: 'saveAs',
|
||||
});
|
||||
|
||||
registerCommand({
|
||||
id: 'group.undo',
|
||||
category: null,
|
||||
isGroupCommand: true,
|
||||
name: 'Undo',
|
||||
keyText: 'Ctrl+Z',
|
||||
group: 'undo',
|
||||
});
|
||||
|
||||
registerCommand({
|
||||
id: 'group.redo',
|
||||
category: null,
|
||||
isGroupCommand: true,
|
||||
name: 'Redo',
|
||||
keyText: 'Ctrl+Y',
|
||||
group: 'redo',
|
||||
});
|
||||
|
||||
if (electron) {
|
||||
registerCommand({
|
||||
id: 'file.open',
|
||||
@@ -175,6 +193,7 @@ export function registerFileCommands({
|
||||
execute = false,
|
||||
toggleComment = false,
|
||||
findReplace = false,
|
||||
undoRedo = false,
|
||||
}) {
|
||||
registerCommand({
|
||||
id: idPrefix + '.save',
|
||||
@@ -248,4 +267,22 @@ export function registerFileCommands({
|
||||
onClick: () => getCurrentEditor().replace(),
|
||||
});
|
||||
}
|
||||
if (undoRedo) {
|
||||
registerCommand({
|
||||
id: idPrefix + '.undo',
|
||||
category,
|
||||
name: 'Undo',
|
||||
group: 'undo',
|
||||
testEnabled: () => getCurrentEditor()?.canUndo(),
|
||||
onClick: () => getCurrentEditor().undo(),
|
||||
});
|
||||
registerCommand({
|
||||
id: idPrefix + '.redo',
|
||||
category,
|
||||
group: 'redo',
|
||||
name: 'Replace',
|
||||
testEnabled: () => getCurrentEditor()?.canRedo(),
|
||||
onClick: () => getCurrentEditor().redo(),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user