mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-02 16:03:59 +00:00
SYNC: Change or add option to disable Shift + Space for AI Assistant #1060
This commit is contained in:
committed by
Diflow
parent
3aea01fb78
commit
880bb0d7cb
@@ -522,19 +522,22 @@
|
|||||||
|
|
||||||
async function handleKeyDown(event) {
|
async function handleKeyDown(event) {
|
||||||
if (isProApp()) {
|
if (isProApp()) {
|
||||||
if (event.code == 'Space' && event.shiftKey && !isAiAssistantVisible) {
|
if (event.code == 'Space' && event.shiftKey && event.ctrlKey && !isAiAssistantVisible) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
toggleAiAssistant();
|
toggleAiAssistant();
|
||||||
await sleep(100);
|
await sleep(100);
|
||||||
if (domAiAssistant) {
|
if (domAiAssistant) {
|
||||||
domAiAssistant.handleCompleteOnCursor();
|
domAiAssistant.handleCompleteOnCursor();
|
||||||
domEditor?.getEditor()?.focus();
|
domEditor?.getEditor()?.focus();
|
||||||
}
|
}
|
||||||
} else if (event.code == 'Space' && event.shiftKey && isAiAssistantVisible && domAiAssistant) {
|
} else if (event.code == 'Space' && event.shiftKey && event.ctrlKey && isAiAssistantVisible && domAiAssistant) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
domAiAssistant.handleCompleteOnCursor();
|
domAiAssistant.handleCompleteOnCursor();
|
||||||
} else if (event.code?.startsWith('Digit') && event.altKey && isAiAssistantVisible && domAiAssistant) {
|
} else if (event.code?.startsWith('Digit') && event.altKey && isAiAssistantVisible && domAiAssistant) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
domAiAssistant.insertCompletion(parseInt(event.code.substring(5)) - 1);
|
domAiAssistant.insertCompletion(parseInt(event.code.substring(5)) - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user