summaryrefslogtreecommitdiff
path: root/src/plugins/texteditor/snippets/snippetoverlay.cpp
diff options
context:
space:
mode:
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 6824c0470a..f7b3cf80c9 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) {