Exclude current file cache from request

This commit is contained in:
Petr Mironychev
2024-09-11 01:37:57 +02:00
parent cd1a9e16e0
commit 2fb876ff00
3 changed files with 8 additions and 6 deletions

View File

@ -72,12 +72,14 @@ void ChangesManager::addChange(TextEditor::TextDocument *document,
logMessage(QString("ChangesManager: Document queue size %1").arg(documentQueue.size()));
}
QString ChangesManager::getRecentChangesContext() const
QString ChangesManager::getRecentChangesContext(const TextEditor::TextDocument *currentDocument) const
{
QString context;
for (const auto &documentChanges : m_documentChanges) {
for (const auto &change : documentChanges) {
context += change.lineContent + "\n";
for (auto it = m_documentChanges.constBegin(); it != m_documentChanges.constEnd(); ++it) {
if (it.key() != currentDocument) {
for (const auto &change : it.value()) {
context += change.lineContent + "\n";
}
}
}
return context;