Commit 21e517ad authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

Make sure only the landed view shows the highlight

parent e691b7d7
......@@ -968,12 +968,12 @@ public:
if (document && uri == document->url()) {
activeView->setCursorPosition(cdef);
highlightLandingLocation(document, location);
highlightLandingLocation(activeView, location);
} else {
KTextEditor::View *view = m_mainWindow->openUrl(uri);
if (view) {
view->setCursorPosition(cdef);
highlightLandingLocation(view->document(), location);
highlightLandingLocation(view, location);
}
}
}
......@@ -981,9 +981,11 @@ public:
/**
* @brief give a short 1sec temporary highlight where you land
*/
void highlightLandingLocation(KTextEditor::Document* doc, const KTextEditor::Range& location)
void highlightLandingLocation(KTextEditor::View* view, const KTextEditor::Range& location)
{
Q_ASSERT(doc);
auto doc = view->document();
if (!doc)
return;
auto miface = qobject_cast<KTextEditor::MovingInterface*>(doc);
if (!miface)
return;
......@@ -993,6 +995,7 @@ public:
attr = new KTextEditor::Attribute;
attr->setUnderlineStyle(QTextCharFormat::SingleUnderline);
}
mr->setView(view);
mr->setAttribute(attr);
QTimer::singleShot(1000, this, [mr](){
mr->setRange(KTextEditor::Range::invalid());
......
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