summaryrefslogtreecommitdiff
path: root/src/plugins/texteditor/snippets/snippetoverlay.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2023-01-05 09:47:06 +0100
committerEike Ziller <eike.ziller@qt.io>2023-01-05 09:47:06 +0100
commit098c7176788a4a692b1c360e37c07b68a60ae5a1 (patch)
treeeafa1436636da2cd729968f9db04be0d38f0a46f /src/plugins/texteditor/snippets/snippetoverlay.cpp
parentea35ed9ffed341884c1465f09d046ccd5f37fa0d (diff)
parent0a74a1e99e37e6685e627577dd52d4f06e3c2832 (diff)
downloadqt-creator-098c7176788a4a692b1c360e37c07b68a60ae5a1.tar.gz
Merge remote-tracking branch 'origin/9.0'
Conflicts: src/plugins/qtsupport/qtoptionspage.cpp Change-Id: Ic8ada9fd47f5eb62e751b6188a45b95ddb36122d
Diffstat (limited to 'src/plugins/texteditor/snippets/snippetoverlay.cpp')
-rw-r--r--src/plugins/texteditor/snippets/snippetoverlay.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/texteditor/snippets/snippetoverlay.cpp b/src/plugins/texteditor/snippets/snippetoverlay.cpp
index 05a2391ae6..deac459fc1 100644
--- a/src/plugins/texteditor/snippets/snippetoverlay.cpp
+++ b/src/plugins/texteditor/snippets/snippetoverlay.cpp
@@ -38,8 +38,13 @@ void SnippetOverlay::setFinalSelection(const QTextCursor &cursor, const QColor &
void SnippetOverlay::updateEquivalentSelections(const QTextCursor &cursor)
{
const int &currentIndex = indexForCursor(cursor);
+ if (currentIndex == m_finalSelectionIndex) {
+ accept();
+ return;
+ }
if (currentIndex < 0)
return;
+ QTC_ASSERT(currentIndex < m_selections.size(), return);
const QString &currentText = cursorForIndex(currentIndex).selectedText();
const QList<int> &equivalents = m_variables.value(m_selections[currentIndex].variableIndex);
for (int i : equivalents) {