mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
fixed copy & paste commands
This commit is contained in:
parent
792be82acd
commit
5c24774170
@ -646,12 +646,12 @@ export function registerFileCommands({
|
||||
});
|
||||
}
|
||||
|
||||
if(copyPaste) {
|
||||
if (copyPaste) {
|
||||
registerCommand({
|
||||
id: idPrefix + '.copy',
|
||||
category,
|
||||
name: 'Copy',
|
||||
keyText: 'CtrlOrCommand+C',
|
||||
disableHandleKeyText: 'CtrlOrCommand+C',
|
||||
testEnabled: () => getCurrentEditor() != null,
|
||||
onClick: () => getCurrentEditor().copy(),
|
||||
});
|
||||
@ -659,10 +659,10 @@ export function registerFileCommands({
|
||||
id: idPrefix + '.paste',
|
||||
category,
|
||||
name: 'Paste',
|
||||
keyText: 'CtrlOrCommand+V',
|
||||
disableHandleKeyText: 'CtrlOrCommand+V',
|
||||
testEnabled: () => getCurrentEditor() != null,
|
||||
onClick: () => getCurrentEditor().paste(),
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
if (findReplace) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
<script lang="ts" context="module">
|
||||
import registerCommand from "../commands/registerCommand";
|
||||
import {copyTextToClipboard} from "../utility/clipboard";
|
||||
import registerCommand from '../commands/registerCommand';
|
||||
import { copyTextToClipboard } from '../utility/clipboard';
|
||||
|
||||
const getCurrentEditor = () => getActiveComponent('QueryTab');
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
toggleComment: true,
|
||||
findReplace: true,
|
||||
executeAdditionalCondition: () => getCurrentEditor()?.hasConnection(),
|
||||
copyPaste: true
|
||||
copyPaste: true,
|
||||
});
|
||||
registerCommand({
|
||||
id: 'query.executeCurrent',
|
||||
@ -83,7 +83,7 @@
|
||||
import ToolStripExportButton, { createQuickExportHandlerRef } from '../buttons/ToolStripExportButton.svelte';
|
||||
import ToolStripSaveButton from '../buttons/ToolStripSaveButton.svelte';
|
||||
import ToolStripCommandSplitButton from '../buttons/ToolStripCommandSplitButton.svelte';
|
||||
import {getClipboardText} from "../utility/clipboard";
|
||||
import { getClipboardText } from '../utility/clipboard';
|
||||
|
||||
export let tabid;
|
||||
export let conid;
|
||||
@ -250,7 +250,7 @@
|
||||
}
|
||||
|
||||
export function paste() {
|
||||
getClipboardText().then((text) => {
|
||||
getClipboardText().then(text => {
|
||||
domEditor.getEditor().execCommand('paste', text);
|
||||
});
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ function mapItem(item, commands) {
|
||||
if (command) {
|
||||
return {
|
||||
text: item.text || command.menuName || command.toolbarName || command.name,
|
||||
keyText: command.keyText || command.keyTextFromGroup,
|
||||
keyText: command.keyText || command.keyTextFromGroup || command.disableHandleKeyText,
|
||||
onClick: () => {
|
||||
if (command.isGroupCommand) {
|
||||
runGroupCommand(command.group);
|
||||
|
Loading…
Reference in New Issue
Block a user