mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2024-08-17 17:20:40 +03:00
chatviewtextprocessor: fix missing #include and simplify sort
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
parent
f6f265f968
commit
1712830228
@ -23,6 +23,9 @@
|
||||
#include <Qt>
|
||||
#include <QtGlobal>
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
|
||||
enum Language {
|
||||
None,
|
||||
Python,
|
||||
@ -1191,9 +1194,7 @@ void ChatViewTextProcessor::handleMarkdown()
|
||||
|
||||
|
||||
if (!hasAlreadyProcessedMarkdown) {
|
||||
std::sort(codeBlockPositions.begin(), codeBlockPositions.end(), [](const QPair<int, int> &a, const QPair<int, int> &b) {
|
||||
return a.first > b.first;
|
||||
});
|
||||
std::sort(codeBlockPositions.begin(), codeBlockPositions.end(), std::greater<>());
|
||||
|
||||
int lastIndex = doc->characterCount() - 1;
|
||||
for (const auto &pos : codeBlockPositions) {
|
||||
|
Loading…
Reference in New Issue
Block a user