Commit c4c5abfc authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau

Merge branch '5.4'

parents 81719b97 59bb1e4a
......@@ -140,5 +140,10 @@
<provides>
<binary>kdevelop</binary>
</provides>
<icon type="stock">kdevelop</icon>
<categories>
<category>Development</category>
<category>IDE</category>
</categories>
<update_contact>kfunk@kde.org</update_contact>
</component>
......@@ -489,7 +489,6 @@ static QVector<KDevelop::IProblem::Ptr> findProblemsUnderCursor(TopDUContext* to
static QVector<KDevelop::IProblem::Ptr> findProblemsCloseToCursor(const TopDUContext* topContext,
KTextEditor::Cursor position,
const KTextEditor::View* view,
KTextEditor::Range& handleRange)
{
handleRange = KTextEditor::Range::invalid();
......@@ -539,28 +538,6 @@ static QVector<KDevelop::IProblem::Ptr> findProblemsCloseToCursor(const TopDUCon
break;
}
// If not, only show it in case there's only whitespace
// between the current cursor position and the problem line
if (closestProblems.isEmpty()) {
for (auto& problem : qAsConst(allProblems)) {
auto r = problem->finalLocation();
KTextEditor::Range dist;
KTextEditor::Cursor bound(r.start().line(), 0);
if (position < r.start())
dist = KTextEditor::Range(position, bound);
else {
bound.setLine(r.end().line() + 1);
dist = KTextEditor::Range(bound, position);
}
if (view->document()->text(dist).trimmed().isEmpty())
closestProblems += problem;
else
break;
}
}
if (!closestProblems.isEmpty()) {
auto it = closestProblems.constBegin();
handleRange = (*it)->finalLocation();
......@@ -657,7 +634,7 @@ QWidget* ContextBrowserPlugin::navigationWidgetForPosition(KTextEditor::View* vi
// Nothing has been found so far which created a widget.
// Thus, find the closest problem to the cursor in a second pass.
if (topContext) {
problems = findProblemsCloseToCursor(topContext, position, view, itemRange);
problems = findProblemsCloseToCursor(topContext, position, itemRange);
if (!problems.isEmpty()) {
// Return nullptr if the correct contents are already being shown in the tool tip currently.
if (m_currentToolTip &&
......
Markdown is supported
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