fixed copy & paste commands

This commit is contained in:
Jan Prochazka 2024-05-09 13:03:05 +02:00
parent 792be82acd
commit 5c24774170
3 changed files with 10 additions and 10 deletions

View File

@ -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) {

View File

@ -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);
});
}

View File

@ -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);