SYNC: Change or add option to disable Shift + Space for AI Assistant #1060

This commit is contained in:
SPRINX0\prochazka
2025-03-03 15:14:00 +01:00
committed by Diflow
parent 3aea01fb78
commit 880bb0d7cb

View File

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