diff --git a/gpt4all-chat/chatviewtextprocessor.cpp b/gpt4all-chat/chatviewtextprocessor.cpp index 6632a3f1..e8858e00 100644 --- a/gpt4all-chat/chatviewtextprocessor.cpp +++ b/gpt4all-chat/chatviewtextprocessor.cpp @@ -24,7 +24,6 @@ #include #include -#include enum Language { None, @@ -1194,7 +1193,9 @@ void ChatViewTextProcessor::handleMarkdown() if (!hasAlreadyProcessedMarkdown) { - std::sort(codeBlockPositions.begin(), codeBlockPositions.end(), std::greater<>()); + std::sort(codeBlockPositions.begin(), codeBlockPositions.end(), [](const QPair &a, const QPair &b) { + return a.first > b.first; + }); int lastIndex = doc->characterCount() - 1; for (const auto &pos : codeBlockPositions) {