diff options
author | Eike Ziller <eike.ziller@qt.io> | 2021-08-03 14:19:44 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2021-08-03 14:19:44 +0200 |
commit | 17d716118a33df720c4acc06490a8fb02e83ec1d (patch) | |
tree | ff2254ccd3be831dee7a254a7f6aa181a48a6d6a /src/plugins/cpptools | |
parent | 91d3d83eabc6372e33e6a7553488d6086fd2d84b (diff) | |
parent | f0bc9036f8e685b8122eb36a48154b0dcf1a5532 (diff) |
Merge remote-tracking branch 'origin/5.0'
Change-Id: I4236e3d2f87d56aea787905f4b78b1f5f933c069
Diffstat (limited to 'src/plugins/cpptools')
-rw-r--r-- | src/plugins/cpptools/semantichighlighter.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/cpptools/semantichighlighter.cpp b/src/plugins/cpptools/semantichighlighter.cpp index 67ce04e042..d30f4d97c5 100644 --- a/src/plugins/cpptools/semantichighlighter.cpp +++ b/src/plugins/cpptools/semantichighlighter.cpp @@ -210,7 +210,13 @@ void SemanticHighlighter::onHighlighterResultAvailable(int from, int to) } QTC_ASSERT(paren.pos != -1, continue); paren.source = parenSource(); - parentheses.second << paren; + + static const auto posCmp = [](const Parenthesis &p1, const Parenthesis &p2) { + return p1.pos < p2.pos; + }; + const auto it = std::lower_bound(parentheses.second.begin(), parentheses.second.end(), + paren, posCmp); + parentheses.second.insert(it, paren); } if (parentheses.first.isValid()) TextDocumentLayout::setParentheses(parentheses.first, parentheses.second); |