From 7b4c531f69feb4dee34ed99d88071ce71ef14086 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 14 Dec 2023 08:38:02 +0100 Subject: [PATCH] Editor: fix inserting snippet selections Fixes: QTCREATORBUG-30071 Change-Id: Ie4156b4b123fc342ed752c7c1ff353e7fb4797db Reviewed-by: Marcus Tillmanns --- src/plugins/texteditor/texteditoroverlay.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/texteditor/texteditoroverlay.cpp b/src/plugins/texteditor/texteditoroverlay.cpp index ab2e9f1279c..2f3a35daa39 100644 --- a/src/plugins/texteditor/texteditoroverlay.cpp +++ b/src/plugins/texteditor/texteditoroverlay.cpp @@ -86,7 +86,7 @@ void TextEditorOverlay::addOverlaySelection(int begin, int end, const auto it = std::find_if(m_selections.cbegin(), m_selections.cend(), [&](const OverlaySelection &selection) { - return begin > selection.m_cursor_begin.position(); + return selection.m_cursor_begin.position() > begin; }); m_selections.insert(it, selection); update();