mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 07:56:01 +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) {
|
||||
if (isProApp()) {
|
||||
if (event.code == 'Space' && event.shiftKey && !isAiAssistantVisible) {
|
||||
if (event.code == 'Space' && event.shiftKey && event.ctrlKey && !isAiAssistantVisible) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
toggleAiAssistant();
|
||||
await sleep(100);
|
||||
if (domAiAssistant) {
|
||||
domAiAssistant.handleCompleteOnCursor();
|
||||
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.stopPropagation();
|
||||
domAiAssistant.handleCompleteOnCursor();
|
||||
} else if (event.code?.startsWith('Digit') && event.altKey && isAiAssistantVisible && domAiAssistant) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
domAiAssistant.insertCompletion(parseInt(event.code.substring(5)) - 1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user