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