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
@ -651,7 +651,7 @@ export function registerFileCommands({
|
|||||||
id: idPrefix + '.copy',
|
id: idPrefix + '.copy',
|
||||||
category,
|
category,
|
||||||
name: 'Copy',
|
name: 'Copy',
|
||||||
keyText: 'CtrlOrCommand+C',
|
disableHandleKeyText: 'CtrlOrCommand+C',
|
||||||
testEnabled: () => getCurrentEditor() != null,
|
testEnabled: () => getCurrentEditor() != null,
|
||||||
onClick: () => getCurrentEditor().copy(),
|
onClick: () => getCurrentEditor().copy(),
|
||||||
});
|
});
|
||||||
@ -659,10 +659,10 @@ export function registerFileCommands({
|
|||||||
id: idPrefix + '.paste',
|
id: idPrefix + '.paste',
|
||||||
category,
|
category,
|
||||||
name: 'Paste',
|
name: 'Paste',
|
||||||
keyText: 'CtrlOrCommand+V',
|
disableHandleKeyText: 'CtrlOrCommand+V',
|
||||||
testEnabled: () => getCurrentEditor() != null,
|
testEnabled: () => getCurrentEditor() != null,
|
||||||
onClick: () => getCurrentEditor().paste(),
|
onClick: () => getCurrentEditor().paste(),
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (findReplace) {
|
if (findReplace) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts" context="module">
|
<script lang="ts" context="module">
|
||||||
import registerCommand from "../commands/registerCommand";
|
import registerCommand from '../commands/registerCommand';
|
||||||
import {copyTextToClipboard} from "../utility/clipboard";
|
import { copyTextToClipboard } from '../utility/clipboard';
|
||||||
|
|
||||||
const getCurrentEditor = () => getActiveComponent('QueryTab');
|
const getCurrentEditor = () => getActiveComponent('QueryTab');
|
||||||
|
|
||||||
@ -40,7 +40,7 @@
|
|||||||
toggleComment: true,
|
toggleComment: true,
|
||||||
findReplace: true,
|
findReplace: true,
|
||||||
executeAdditionalCondition: () => getCurrentEditor()?.hasConnection(),
|
executeAdditionalCondition: () => getCurrentEditor()?.hasConnection(),
|
||||||
copyPaste: true
|
copyPaste: true,
|
||||||
});
|
});
|
||||||
registerCommand({
|
registerCommand({
|
||||||
id: 'query.executeCurrent',
|
id: 'query.executeCurrent',
|
||||||
@ -83,7 +83,7 @@
|
|||||||
import ToolStripExportButton, { createQuickExportHandlerRef } from '../buttons/ToolStripExportButton.svelte';
|
import ToolStripExportButton, { createQuickExportHandlerRef } from '../buttons/ToolStripExportButton.svelte';
|
||||||
import ToolStripSaveButton from '../buttons/ToolStripSaveButton.svelte';
|
import ToolStripSaveButton from '../buttons/ToolStripSaveButton.svelte';
|
||||||
import ToolStripCommandSplitButton from '../buttons/ToolStripCommandSplitButton.svelte';
|
import ToolStripCommandSplitButton from '../buttons/ToolStripCommandSplitButton.svelte';
|
||||||
import {getClipboardText} from "../utility/clipboard";
|
import { getClipboardText } from '../utility/clipboard';
|
||||||
|
|
||||||
export let tabid;
|
export let tabid;
|
||||||
export let conid;
|
export let conid;
|
||||||
@ -250,7 +250,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function paste() {
|
export function paste() {
|
||||||
getClipboardText().then((text) => {
|
getClipboardText().then(text => {
|
||||||
domEditor.getEditor().execCommand('paste', text);
|
domEditor.getEditor().execCommand('paste', text);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ function mapItem(item, commands) {
|
|||||||
if (command) {
|
if (command) {
|
||||||
return {
|
return {
|
||||||
text: item.text || command.menuName || command.toolbarName || command.name,
|
text: item.text || command.menuName || command.toolbarName || command.name,
|
||||||
keyText: command.keyText || command.keyTextFromGroup,
|
keyText: command.keyText || command.keyTextFromGroup || command.disableHandleKeyText,
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
if (command.isGroupCommand) {
|
if (command.isGroupCommand) {
|
||||||
runGroupCommand(command.group);
|
runGroupCommand(command.group);
|
||||||
|
Loading…
Reference in New Issue
Block a user