Commit 127c5c1f authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

lsp: remove diagnostic model rows in groups

(cherry picked from commit 4b605683)
parent 8cfbc4e1
Pipeline #262791 canceled with stage
in 7 minutes and 48 seconds
......@@ -2902,15 +2902,29 @@ public:
}
// check and clear defunct entries
const auto &model = *m_diagnosticsModel;
// Remove rows in groups
int start = -1, count = 0;
for (int i = 0; i < model.rowCount(); ++i) {
auto item = model.item(i);
if (item && !fpaths.contains(item->text())) {
item->setRowCount(0);
if (m_diagnosticsTree) {
m_diagnosticsTree->setRowHidden(item->row(), QModelIndex(), true);
if (start == -1) {
start = i;
}
count += 1;
} else {
if (start > -1 && count != 0) {
m_diagnosticsModel->removeRows(start, count);
i = start - 1; // reset i
}
start = -1;
count = 0;
}
}
if (start != -1 && count != 0) {
m_diagnosticsModel->removeRows(start, count);
}
}
void onTextChanged(KTextEditor::Document *doc)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment