diff options
author | Eike Ziller <eike.ziller@qt.io> | 2023-01-05 09:47:06 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2023-01-05 09:47:06 +0100 |
commit | 098c7176788a4a692b1c360e37c07b68a60ae5a1 (patch) | |
tree | eafa1436636da2cd729968f9db04be0d38f0a46f /src/plugins/texteditor/snippets/snippetoverlay.cpp | |
parent | ea35ed9ffed341884c1465f09d046ccd5f37fa0d (diff) | |
parent | 0a74a1e99e37e6685e627577dd52d4f06e3c2832 (diff) | |
download | qt-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.cpp | 5 |
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 ¤tIndex = indexForCursor(cursor); + if (currentIndex == m_finalSelectionIndex) { + accept(); + return; + } if (currentIndex < 0) return; + QTC_ASSERT(currentIndex < m_selections.size(), return); const QString ¤tText = cursorForIndex(currentIndex).selectedText(); const QList<int> &equivalents = m_variables.value(m_selections[currentIndex].variableIndex); for (int i : equivalents) { |