Commit bd160706 authored by Ilia Kats's avatar Ilia Kats Committed by Christoph Cullmann
Browse files

check if we actually found matches

parent 9e2fa965
......@@ -41,8 +41,10 @@ void LatexCompletionModel::completionInvoked(KTextEditor::View *view,
auto prefixrangeend = std::upper_bound(beginit, endit, word, [](const QString &a, const Completion &b) -> bool {
return b.completion.startsWith(a) ? false : a < b.completion;
});
m_matches.first = std::distance(beginit, prefixrangestart);
m_matches.second = std::distance(beginit, prefixrangeend);
if (prefixrangestart != endit) {
m_matches.first = std::distance(beginit, prefixrangestart);
m_matches.second = std::distance(beginit, prefixrangeend);
}
}
endResetModel();
}
......
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