Editor: fix inserting snippet selections

Fixes: QTCREATORBUG-30071
Change-Id: Ie4156b4b123fc342ed752c7c1ff353e7fb4797db
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
David Schulz
2023-12-14 08:38:02 +01:00
parent a39dd6d425
commit 7b4c531f69

View File

@@ -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();