forked from qt-creator/qt-creator
Clang: Fix removing text marks on line deletion
Task-number: QTCREATORBUG-17270 Change-Id: I582015597a65141e420622dcdb50e82f9791b189 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -346,7 +346,12 @@ void ClangDiagnosticManager::addClangTextMarks(
|
||||
const QVector<ClangBackEnd::DiagnosticContainer> &diagnostics)
|
||||
{
|
||||
for (const ClangBackEnd::DiagnosticContainer &diagnostic : diagnostics) {
|
||||
auto textMark = new ClangTextMark(filePath(), diagnostic);
|
||||
const auto onMarkRemoved = [this](const ClangTextMark *mark) {
|
||||
const auto it = std::remove(m_clangTextMarks.begin(), m_clangTextMarks.end(), mark);
|
||||
m_clangTextMarks.erase(it, m_clangTextMarks.end());
|
||||
delete mark;
|
||||
};
|
||||
auto textMark = new ClangTextMark(filePath(), diagnostic, onMarkRemoved);
|
||||
m_clangTextMarks.push_back(textMark);
|
||||
m_textDocument->addMark(textMark);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user