diff options
author | David Schulz <[email protected]> | 2023-10-12 13:27:50 +0200 |
---|---|---|
committer | David Schulz <[email protected]> | 2023-10-12 12:13:34 +0000 |
commit | 03e064f1ce858bd3ee1e4e492175b11463b8e938 (patch) | |
tree | eccacaee1170603c0463d55695ab88b07353ee78 /src/plugins/copilot | |
parent | be47810673c8d525106118010ebc1c45abbf38a1 (diff) |
Copilot: Do not request completions for read only editors
Fixes: QTCREATORBUG-29738
Change-Id: I7e894a079595265f163c63243a3e8b098696f696
Reviewed-by: Marcus Tillmanns <[email protected]>
Diffstat (limited to 'src/plugins/copilot')
-rw-r--r-- | src/plugins/copilot/copilotclient.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/copilot/copilotclient.cpp b/src/plugins/copilot/copilotclient.cpp index c166e2e37f6..6b09882dee9 100644 --- a/src/plugins/copilot/copilotclient.cpp +++ b/src/plugins/copilot/copilotclient.cpp @@ -129,7 +129,7 @@ void CopilotClient::openDocument(TextDocument *document) if (!textEditor || textEditor->document() != document) return; TextEditorWidget *widget = textEditor->editorWidget(); - if (widget->multiTextCursor().hasMultipleCursors()) + if (widget->isReadOnly() || widget->multiTextCursor().hasMultipleCursors()) return; const int cursorPosition = widget->textCursor().position(); if (cursorPosition < position || cursorPosition > position + charsAdded) |